Skip to content

Instantly share code, notes, and snippets.

@spanuska
Last active March 14, 2016 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spanuska/488f02e6aeb4f80cc8f6 to your computer and use it in GitHub Desktop.
Save spanuska/488f02e6aeb4f80cc8f6 to your computer and use it in GitHub Desktop.
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