Class: Libri::Awards
- Inherits:
-
Object
- Object
- Libri::Awards
- Defined in:
- lib/libri/awards.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(awards_hash) ⇒ Awards
constructor
A new instance of Awards.
Constructor Details
#initialize(awards_hash) ⇒ Awards
Returns a new instance of Awards.
6 7 8 9 10 11 |
# File 'lib/libri/awards.rb', line 6 def initialize(awards_hash) awards_hash.map { |key, val| send "#{key}=", val } @@all << self end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/libri/awards.rb', line 2 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/libri/awards.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
19 20 21 |
# File 'lib/libri/awards.rb', line 19 def self.all @@all end |
.create_from_collection(awards_array) ⇒ Object
13 14 15 16 17 |
# File 'lib/libri/awards.rb', line 13 def self.create_from_collection(awards_array) awards_array.map { |awards_hash| self.new(awards_hash) } end |