Class: DayOfMonth

Inherits:
Object
  • Object
show all
Defined in:
lib/dayofmonth.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#daysObject

Returns the value of attribute days.



2
3
4
# File 'lib/dayofmonth.rb', line 2

def days
  @days
end

#titleObject

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