Class: DayOfMonth
- Inherits:
-
Object
- Object
- DayOfMonth
- Defined in:
- lib/dayofmonth.rb
Instance Attribute Summary collapse
-
#days ⇒ Object
Returns the value of attribute days.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
-
.array_from_hash_array(hash_array) ⇒ Object
utility method to take the array of hashes returned by the scraper and turn them into instances of this object.
Instance Method Summary collapse
-
#initialize(hash) ⇒ DayOfMonth
constructor
A new instance of DayOfMonth.
Constructor Details
#initialize(hash) ⇒ DayOfMonth
Returns a new instance of DayOfMonth.
11 12 13 14 15 16 |
# File 'lib/dayofmonth.rb', line 11 def initialize(hash) hash.each do |k,v| self.send("#{k}=",v) end @days = @days.collect {|day| NationalDay.new(day)} end |
Instance Attribute Details
#days ⇒ Object
Returns the value of attribute days.
2 3 4 |
# File 'lib/dayofmonth.rb', line 2 def days @days end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/dayofmonth.rb', line 2 def title @title end |
Class Method Details
.array_from_hash_array(hash_array) ⇒ Object
utility method to take the array of hashes returned by the scraper and turn them into instances of this object
5 6 7 8 9 |
# File 'lib/dayofmonth.rb', line 5 def self.array_from_hash_array(hash_array) hash_array.collect {|hash| self.new(hash) } end |