class Libri::Books

Attributes

author[RW]
title[RW]
url[RW]

Public Class Methods

all() click to toggle source
# File lib/libri/books.rb, line 19
def self.all
    @@all
end
create_from_collection(books_array) click to toggle source
# File lib/libri/books.rb, line 13
def self.create_from_collection(books_array)
    books_array.map { |books_hash|
        self.new(books_hash)
    }
end
new(books_hash) click to toggle source
# File lib/libri/books.rb, line 6
def initialize(books_hash) 
    books_hash.map { |key, val|
        send "#{key}=", val
    }
    @@all << self
end