Class: MPXJ::Calendar
Overview
Represents a calendar
Instance Attribute Summary collapse
-
#days ⇒ Object
readonly
Returns the value of attribute days.
-
#exceptions ⇒ Object
readonly
Returns the value of attribute exceptions.
-
#weeks ⇒ Object
readonly
Returns the value of attribute weeks.
Attributes inherited from Container
#attribute_values, #parent_project
Instance Method Summary collapse
-
#guid ⇒ String
Retrieve the calendar GUID.
-
#initialize(parent_project, attribute_values) ⇒ Calendar
constructor
A new instance of Calendar.
-
#minutes_per_day ⇒ Integer?
Retrieve the number of minutes per day.
-
#minutes_per_month ⇒ Integer?
Retrieve the number of minutes per month.
-
#minutes_per_week ⇒ Integer?
Retrieve the number of minutes per week.
-
#minutes_per_year ⇒ Integer?
Retrieve the number of minutes per year.
-
#name ⇒ String
Retrieve the calendar name.
-
#parent_calendar ⇒ Calendar?
Retrieve the parent calendar of this calendar.
-
#parent_unique_id ⇒ Integer?
Retrieve the parent calendar unique ID.
-
#personal ⇒ Boolean
Retrieve the personal flag.
-
#type ⇒ String
Retrieve the calendar type.
-
#unique_id ⇒ Integer
Retrieve the calendar unique ID.
Constructor Details
#initialize(parent_project, attribute_values) ⇒ Calendar
Returns a new instance of Calendar.
8 9 10 11 12 13 |
# File 'lib/mpxj/calendar.rb', line 8 def initialize(parent_project, attribute_values) super(parent_project, attribute_values.slice('unique_id', 'guid', 'parent_unique_id', 'name', 'type', 'personal', 'minutes_per_day', 'minutes_per_week', 'minutes_per_month', 'minutes_per_year')) process_days(attribute_values) process_weeks(attribute_values) process_exceptions(attribute_values) end |
Instance Attribute Details
#days ⇒ Object (readonly)
Returns the value of attribute days.
4 5 6 |
# File 'lib/mpxj/calendar.rb', line 4 def days @days end |
#exceptions ⇒ Object (readonly)
Returns the value of attribute exceptions.
6 7 8 |
# File 'lib/mpxj/calendar.rb', line 6 def exceptions @exceptions end |
#weeks ⇒ Object (readonly)
Returns the value of attribute weeks.
5 6 7 |
# File 'lib/mpxj/calendar.rb', line 5 def weeks @weeks end |
Instance Method Details
#guid ⇒ String
Retrieve the calendar GUID
25 26 27 |
# File 'lib/mpxj/calendar.rb', line 25 def guid attribute_values['guid'] end |
#minutes_per_day ⇒ Integer?
Retrieve the number of minutes per day
70 71 72 |
# File 'lib/mpxj/calendar.rb', line 70 def minutes_per_day get_nillable_integer_value(attribute_values['minutes_per_day']) end |
#minutes_per_month ⇒ Integer?
Retrieve the number of minutes per month
86 87 88 |
# File 'lib/mpxj/calendar.rb', line 86 def minutes_per_month get_nillable_integer_value(attribute_values['minutes_per_month']) end |
#minutes_per_week ⇒ Integer?
Retrieve the number of minutes per week
78 79 80 |
# File 'lib/mpxj/calendar.rb', line 78 def minutes_per_week get_nillable_integer_value(attribute_values['minutes_per_week']) end |
#minutes_per_year ⇒ Integer?
Retrieve the number of minutes per year
94 95 96 |
# File 'lib/mpxj/calendar.rb', line 94 def minutes_per_year get_nillable_integer_value(attribute_values['minutes_per_year']) end |
#name ⇒ String
Retrieve the calendar name
48 49 50 |
# File 'lib/mpxj/calendar.rb', line 48 def name attribute_values['name'] end |
#parent_calendar ⇒ Calendar?
Retrieve the parent calendar of this calendar
41 42 43 |
# File 'lib/mpxj/calendar.rb', line 41 def parent_calendar parent_project.get_calendar_by_unique_id(attribute_values['parent_unique_id']&.to_i) end |
#parent_unique_id ⇒ Integer?
Retrieve the parent calendar unique ID
33 34 35 |
# File 'lib/mpxj/calendar.rb', line 33 def parent_unique_id get_nillable_integer_value(attribute_values['parent_unique_id']) end |
#personal ⇒ Boolean
Retrieve the personal flag
62 63 64 |
# File 'lib/mpxj/calendar.rb', line 62 def personal get_boolean_value(attribute_values['personal']) end |
#type ⇒ String
Retrieve the calendar type
55 56 57 |
# File 'lib/mpxj/calendar.rb', line 55 def type attribute_values['type'] end |
#unique_id ⇒ Integer
Retrieve the calendar unique ID
18 19 20 |
# File 'lib/mpxj/calendar.rb', line 18 def unique_id get_integer_value(attribute_values['unique_id']) end |