Sha256: 9d0a53bf6fc652d96e40aba4e8b1d2bc16c3058f3ff7478e21e969596d06d0c1

Contents?: true

Size: 397 Bytes

Versions: 4

Compression:

Stored size: 397 Bytes

Contents

class Libri::Awards
    attr_accessor :name, :url

    @@all = []

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

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

    def self.all
        @@all
    end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
libri-0.2.8 lib/libri/awards.rb
libri-0.2.7 lib/libri/awards.rb
libri-0.2.6 lib/libri/awards.rb
libri-0.2.5 lib/libri/awards.rb