Created
February 10, 2017 08:33
-
-
Save vassilevsky/6a07038d3f400ab53e6aea5eb12f3b16 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Something | |
def initialize(foo:, bar:) | |
@foo = foo | |
@bar = bar | |
end | |
# Публичный метод | |
# Можно использовать barewords (foo, bar) | |
# При этом снаружи их нельзя получить | |
def to_s | |
"something (#{foo}, #{bar})" | |
end | |
private | |
attr_reader :foo | |
attr_reader :bar | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment