Sha256: 997305825ad3d60f398fc830fe31f35e0960f84ac3569d5b3b0702222588fb42

Contents?: true

Size: 495 Bytes

Versions: 2

Compression:

Stored size: 495 Bytes

Contents

class Libri::Book
    attr_accessor :title_by_author, :blurbs_and_plot, :about_author,:excerpt,  :availability, :url, :book

    @@all = []

    def initialize(book_info_hash) 
        book_info_hash.each { |key, val|
            send "#{key}=", val
        }
        @@all << self
    end

    def self.create_from_collection(book_info_array)
        book_info_array.each { |book_info_hash|
          self.new(book_info_hash)
        }
    end
    
    def self.all
        @@all
    end 

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
libri-0.2.4 lib/libri/book.rb
libri-0.2.3 lib/libri/book.rb