Class: NexosisApi::CalendarJoinTarget

Inherits:
Object
  • Object
show all
Defined in:
lib/nexosis_api/calendar_jointarget.rb

Overview

Specifies the details of a calendar data source to join to

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cal_join_hash) ⇒ CalendarJoinTarget

Returns a new instance of CalendarJoinTarget.

Since:

  • 1.2.3


6
7
8
9
10
# File 'lib/nexosis_api/calendar_jointarget.rb', line 6

def initialize(cal_join_hash)
  @url = cal_join_hash['url'] unless cal_join_hash.nil?
  @name = cal_join_hash['name'] unless cal_join_hash.nil?
  @timezone = cal_join_hash['timeZone'] unless cal_join_hash.nil?
end

Instance Attribute Details

#nameString

The name of a well-known Nexosis calendar.

Returns:

  • (String)

See Also:

Since:

  • 1.2.3


19
20
21
# File 'lib/nexosis_api/calendar_jointarget.rb', line 19

def name
  @name
end

#timezoneString

tz-db string name of the timezone of the calendar

Returns:

  • (String)

See Also:

Since:

  • 1.2.3


24
25
26
# File 'lib/nexosis_api/calendar_jointarget.rb', line 24

def timezone
  @timezone
end

#urlString

The location of a public iCal to download as the datasource

Returns:

  • (String)

Since:

  • 1.2.3


14
15
16
# File 'lib/nexosis_api/calendar_jointarget.rb', line 14

def url
  @url
end

Instance Method Details

#to_hashObject

custom hash to match with api requests

Since:

  • 1.2.3


27
28
29
30
31
32
33
# File 'lib/nexosis_api/calendar_jointarget.rb', line 27

def to_hash
  hash = { 'calendar' => {} }
  hash['calendar'].store 'url', url unless url.nil?
  hash['calendar'].store 'name', name unless name.nil?
  hash['calendar'].store 'timeZone', name unless timezone.nil?
  hash
end