Class: Bort::Schedule::HolidayData

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#dateObject

Returns the value of attribute date.



153
154
155
# File 'lib/bort/schedule.rb', line 153

def date
  @date
end

#nameObject

Returns the value of attribute name.



153
154
155
# File 'lib/bort/schedule.rb', line 153

def name
  @name
end

#schedule_typeObject

Returns the value of attribute schedule_type.



153
154
155
# File 'lib/bort/schedule.rb', line 153

def schedule_type
  @schedule_type
end

Class Method Details

.parse(doc) ⇒ Object



155
156
157
158
159
160
161
162
# File 'lib/bort/schedule.rb', line 155

def self.parse(doc)
  data                = HolidayData.new
  data.name           = (doc/:name).inner_text
  data.date           = Date.parse((doc/:date).inner_text)
  data.schedule_type  = (doc/:schedule_type).inner_text

  data
end