Class: MppReader::Calendar

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

Overview

Working-time definition. days maps :sunday..:saturday to { type:, hours: } where type is :working, :non_working or :default (inherit from the base calendar) and hours is an array of

start_seconds, end_seconds

ranges within the day. exceptions is an

array of { from:, to:, name:, hours: } overrides; empty hours means a non-working period.

Constant Summary collapse

DAY_NAMES =
%i[sunday monday tuesday wednesday thursday friday saturday].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCalendar

Returns a new instance of Calendar.



14
15
16
17
# File 'lib/mpp_reader/calendar.rb', line 14

def initialize
  @days = {}
  @exceptions = []
end

Instance Attribute Details

#base_calendar_unique_idObject

Returns the value of attribute base_calendar_unique_id.



11
12
13
# File 'lib/mpp_reader/calendar.rb', line 11

def base_calendar_unique_id
  @base_calendar_unique_id
end

#daysObject (readonly)

Returns the value of attribute days.



12
13
14
# File 'lib/mpp_reader/calendar.rb', line 12

def days
  @days
end

#exceptionsObject (readonly)

Returns the value of attribute exceptions.



12
13
14
# File 'lib/mpp_reader/calendar.rb', line 12

def exceptions
  @exceptions
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/mpp_reader/calendar.rb', line 11

def name
  @name
end

#resource_unique_idObject

Returns the value of attribute resource_unique_id.



11
12
13
# File 'lib/mpp_reader/calendar.rb', line 11

def resource_unique_id
  @resource_unique_id
end

#unique_idObject

Returns the value of attribute unique_id.



11
12
13
# File 'lib/mpp_reader/calendar.rb', line 11

def unique_id
  @unique_id
end