class Ekispert::Course::Route::Line::Stop::DepartureState
Attributes
datetime[RW]
datetime_list[RW]
Public Class Methods
new(element)
click to toggle source
Calls superclass method
# File lib/ekispert/course/route/line/stop/departure_state.rb, line 9 def initialize(element) @datetime_list = [] super(element) end
Public Instance Methods
set_date(date)
click to toggle source
Because of emptiness of date information at DepartureState
, set date additionaly ex. <Datetime operation=“today”>12:57:00+09:00</Datetime>
# File lib/ekispert/course/route/line/stop/departure_state.rb, line 16 def set_date(date) time = @datetime_list[0].text.split(/[:\+]/).first(3).map(&:to_i) @datetime = DateTime.new(date.year, date.month, date.day, *time) rescue DateTime.now @datetime += 1 if @datetime_list[0].operation == 'yesterday' end