Sha256: 579bce508bc44240a298e6d618edfecfae1d1812610028588955c228219aa457

Contents?: true

Size: 399 Bytes

Versions: 3

Compression:

Stored size: 399 Bytes

Contents

class Libri::Awards
    attr_accessor :name, :url

    @@all = []

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

    def self.create_from_collection(awards_array)
        awards_array.each { |awards_hash|
            self.new(awards_hash)
        }
    end

    def self.all
        @@all
    end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
libri-0.2.4 lib/libri/awards.rb
libri-0.2.3 lib/libri/awards.rb
libri-0.2.2 lib/libri/awards.rb