-
-
Save nerdEd/376714 to your computer and use it in GitHub Desktop.
This file contains 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
# Is this good? Like on a scale of 1 - 10, 1 being, "oh god my eyes the burning I can't even" | |
# and 10 being, "DO IT MOAR!" | |
class Document | |
attr_accessor :foo, :bar | |
def initialize | |
if block_given? | |
yield self | |
end | |
end | |
def identity | |
"#{ foo } #{ bar }" | |
end | |
end | |
doc = Document.new do |d| | |
d.foo = "HELLO" | |
d.bar = "!DLROW".reverse | |
end | |
p doc.identity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment