Skip to content

Instantly share code, notes, and snippets.

@spanuska
Last active March 14, 2016 19:02
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/961ef156b4bd3639d58e to your computer and use it in GitHub Desktop.
Save spanuska/961ef156b4bd3639d58e to your computer and use it in GitHub Desktop.
class Book
attr_accessor :title, :author
def initialize(args)
args = defaults.merge(args)
@title = args[:title]
...
end
def store_book
# logic for storing the book at a location on the shelf
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