Skip to content

Instantly share code, notes, and snippets.

@spanuska
Last active March 14, 2016 19:54
Embed
What would you like to do?
class Shelf
...
def store(@book)
# logic to find the correct location on itself for @book
end
end
class Book
attr_accessor :title, :author
def initialize(args)
args = defaults.merge(args)
@title = args[:title]
...
end
def defaults
{title: "Unknown", author: "Unknown"}
end
....
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment