lib/libri/book.rb in libri-0.2.4 vs lib/libri/book.rb in libri-0.2.5
- old
+ new
@@ -2,17 +2,17 @@
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|
+ book_info_hash.map { |key, val|
send "#{key}=", val
}
@@all << self
end
def self.create_from_collection(book_info_array)
- book_info_array.each { |book_info_hash|
+ book_info_array.map { |book_info_hash|
self.new(book_info_hash)
}
end
def self.all