Class: Opsgenie::TimelinePeriod

Inherits:
Object
  • Object
show all
Defined in:
lib/opsgenie/timeline_period.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ TimelinePeriod

Returns a new instance of TimelinePeriod.



4
5
6
7
8
# File 'lib/opsgenie/timeline_period.rb', line 4

def initialize(attrs)
  @start_date = DateTime.parse(attrs["startDate"])
  @end_date = DateTime.parse(attrs["endDate"])
  @user = Opsgenie::User.find(attrs["recipient"]["id"])
end

Instance Attribute Details

#end_dateObject (readonly)

Returns the value of attribute end_date.



3
4
5
# File 'lib/opsgenie/timeline_period.rb', line 3

def end_date
  @end_date
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



3
4
5
# File 'lib/opsgenie/timeline_period.rb', line 3

def start_date
  @start_date
end

#userObject (readonly)

Returns the value of attribute user.



3
4
5
# File 'lib/opsgenie/timeline_period.rb', line 3

def user
  @user
end