Sha256: 70a87fc3428273c7a084bb4492090cbc0a367c3650789b30d908f1dc75d91b37
Contents?: true
Size: 969 Bytes
Versions: 4
Compression:
Stored size: 969 Bytes
Contents
module Kosher # A book. # # A book is sold on many venues and has many offers through those venues. class Book < Structure key :asin key :edition key :format key :images, :type => Hash key :isbn key :pages, :type => Integer key :published_in, :type => Integer key :publisher key :title key :volumes, :type => Integer has_many :other_editions has_many :authors has_many :offers has_many :similar_books # The best kosher offer. # # Returns nil if there are no (kosher) offers. def best_kosher_offer offer = offers.sort.first offer && offer.kosher? ? offer : nil end # A full bibliographic description of the book, as in: # # Chronicle Books, 1991. Hardcover. 1st edition. 2 volumes. 1200 pages. # # Missing attributes are omitted. def description # TODO end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
kosher-0.6.2 | lib/kosher/book.rb |
kosher-0.6.1 | lib/kosher/book.rb |
kosher-0.6.0 | lib/kosher/book.rb |
kosher-0.5.0 | lib/kosher/book.rb |