Class: Booker::Models::LocationDaySchedule

Inherits:
Model
  • Object
show all
Defined in:
lib/booker/models/location_day_schedule.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Model

constantize, from_list, #initialize, time_from_booker_datetime, time_to_booker_datetime, timezone_from_booker_offset!, timezone_from_booker_timezone, #to_hash, #to_json, to_wday

Constructor Details

This class inherits a constructor from Booker::Models::Model

Instance Attribute Details

#EndTimeObject

Returns the value of attribute EndTime.



4
5
6
# File 'lib/booker/models/location_day_schedule.rb', line 4

def EndTime
  @EndTime
end

#StartTimeObject

Returns the value of attribute StartTime.



4
5
6
# File 'lib/booker/models/location_day_schedule.rb', line 4

def StartTime
  @StartTime
end

#WeekdayObject

Returns the value of attribute Weekday.



4
5
6
# File 'lib/booker/models/location_day_schedule.rb', line 4

def Weekday
  @Weekday
end

Class Method Details

.from_hash(hash) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/booker/models/location_day_schedule.rb', line 8

def self.from_hash(hash)
  model = super
  model.Weekday = to_wday(model.Weekday)
  strftime_format = '%T'
  model.StartTime = model.StartTime.try(:strftime, strftime_format)
  model.EndTime = model.EndTime.try(:strftime, strftime_format)
  model
end