Class: GoToWebinar::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/go_to_webinar/session.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Session

Returns a new instance of Session.



3
4
5
# File 'lib/go_to_webinar/session.rb', line 3

def initialize(data)
  @data = data
end

Class Method Details

.allObject



57
58
59
# File 'lib/go_to_webinar/session.rb', line 57

def self.all
  make(GoToWebinar.client.get("/organizers/:organizer_key:/sessions"))
end

.find(webinar_key:, session_key:) ⇒ Object



48
49
50
51
# File 'lib/go_to_webinar/session.rb', line 48

def self.find(webinar_key:, session_key:)
  data = make(GoToWebinar.client.get("/organizers/:organizer_key:/webinars/#{webinar_key}/sessions/#{session_key}"))
  Session.new(data)
end

.for_webinar(webinar_key:) ⇒ Object



53
54
55
# File 'lib/go_to_webinar/session.rb', line 53

def self.for_webinar(webinar_key:)
  make(GoToWebinar.client.get("/organizers/:organizer_key:/webinars/#{webinar_key}/sessions"))
end

.make(data) ⇒ Object



61
62
63
# File 'lib/go_to_webinar/session.rb', line 61

def self.make(data)
  data.map { |registrant| Session.new(registrant) }
end

Instance Method Details

#attendeesObject

Get session attendees



44
45
46
# File 'lib/go_to_webinar/session.rb', line 44

def attendees
  Attendee.all_for_session(webinar_key: webinar_key, session_key: session_key)
end

#end_timeObject

endTime* string($date-time) The ending time of the webinar session



39
40
41
# File 'lib/go_to_webinar/session.rb', line 39

def end_time
  @data['endTime']&.to_datetime
end

#registrants_attendedObject

registrantsAttended* integer($int32) The number of registrants who attended the webinar session



15
16
17
# File 'lib/go_to_webinar/session.rb', line 15

def registrants_attended
  @data['registrantsAttended'].to_s
end

#session_keyObject

sessionKey* integer($int64) The unique key of the webinar session



33
34
35
# File 'lib/go_to_webinar/session.rb', line 33

def session_key
  @data['sessionKey'].to_s
end

#start_timeObject

startTime* string($date-time) The starting time of the webinar session



9
10
11
# File 'lib/go_to_webinar/session.rb', line 9

def start_time
  @data['startTime']&.to_datetime
end

#webinar_idObject

webinarID* string The 9-digit webinar ID



27
28
29
# File 'lib/go_to_webinar/session.rb', line 27

def webinar_id
  @data['webinarID'].to_s
end

#webinar_keyObject

webinarKey* integer($int64) The unique key of the webinar



21
22
23
# File 'lib/go_to_webinar/session.rb', line 21

def webinar_key
  @data['webinarKey'].to_s
end