Class: MppReader::Calendar
- Inherits:
-
Object
- Object
- MppReader::Calendar
- 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
-
#base_calendar_unique_id ⇒ Object
Returns the value of attribute base_calendar_unique_id.
-
#days ⇒ Object
readonly
Returns the value of attribute days.
-
#exceptions ⇒ Object
readonly
Returns the value of attribute exceptions.
-
#name ⇒ Object
Returns the value of attribute name.
-
#resource_unique_id ⇒ Object
Returns the value of attribute resource_unique_id.
-
#unique_id ⇒ Object
Returns the value of attribute unique_id.
Instance Method Summary collapse
-
#initialize ⇒ Calendar
constructor
A new instance of Calendar.
Constructor Details
#initialize ⇒ Calendar
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_id ⇒ Object
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 |
#days ⇒ Object (readonly)
Returns the value of attribute days.
12 13 14 |
# File 'lib/mpp_reader/calendar.rb', line 12 def days @days end |
#exceptions ⇒ Object (readonly)
Returns the value of attribute exceptions.
12 13 14 |
# File 'lib/mpp_reader/calendar.rb', line 12 def exceptions @exceptions end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/mpp_reader/calendar.rb', line 11 def name @name end |
#resource_unique_id ⇒ Object
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_id ⇒ Object
Returns the value of attribute unique_id.
11 12 13 |
# File 'lib/mpp_reader/calendar.rb', line 11 def unique_id @unique_id end |