lib/libri/books.rb in libri-0.2.4 vs lib/libri/books.rb in libri-0.2.5

- old
+ new

@@ -2,17 +2,17 @@ attr_accessor :title, :author, :url @@all = [] def initialize(books_hash) - books_hash.each { |key, val| + books_hash.map { |key, val| send "#{key}=", val } @@all << self end def self.create_from_collection(books_array) - books_array.each { |books_hash| + books_array.map { |books_hash| self.new(books_hash) } end def self.all