Class: MPXJ::CalendarException

Inherits:
Container show all
Defined in:
lib/mpxj/calendar_exception.rb

Overview

Represents a calendar exception

Instance Attribute Summary collapse

Attributes inherited from Container

#attribute_values, #parent_project

Instance Method Summary collapse

Constructor Details

#initialize(parent_project, attribute_values) ⇒ CalendarException

Returns a new instance of CalendarException.



6
7
8
9
# File 'lib/mpxj/calendar_exception.rb', line 6

def initialize(parent_project, attribute_values)
  super(parent_project, attribute_values.slice('name', 'from', 'to', 'type'))
  process_hours(attribute_values)
end

Instance Attribute Details

#hoursObject (readonly)

Returns the value of attribute hours.



4
5
6
# File 'lib/mpxj/calendar_exception.rb', line 4

def hours
  @hours
end

Instance Method Details

#fromTime

Retrieve the date on which this exception starts

Returns:

  • (Time)

    the exception from date



21
22
23
# File 'lib/mpxj/calendar_exception.rb', line 21

def from
  get_date_value(attribute_values['from'])
end

#nameString

Retrieve the exception name

Returns:

  • (String)

    the exception name



14
15
16
# File 'lib/mpxj/calendar_exception.rb', line 14

def name
  attribute_values['name']
end

#toTime

Retrieve the date on which this exception ends

Returns:

  • (Time)

    the exception to date



28
29
30
# File 'lib/mpxj/calendar_exception.rb', line 28

def to
  get_date_value(attribute_values['to'])
end

#typeString

Retrieve the exception type

Returns:

  • (String)

    the exception type



35
36
37
# File 'lib/mpxj/calendar_exception.rb', line 35

def type
  attribute_values['type']
end