Class: GoToWebinar::Session
- Inherits:
-
Object
- Object
- GoToWebinar::Session
- Defined in:
- lib/go_to_webinar/session.rb
Class Method Summary collapse
- .all ⇒ Object
- .find(webinar_key:, session_key:) ⇒ Object
- .for_webinar(webinar_key:) ⇒ Object
- .make(data) ⇒ Object
Instance Method Summary collapse
-
#attendees ⇒ Object
Get session attendees.
-
#end_time ⇒ Object
endTime* string($date-time) The ending time of the webinar session.
-
#initialize(data) ⇒ Session
constructor
A new instance of Session.
-
#registrants_attended ⇒ Object
registrantsAttended* integer($int32) The number of registrants who attended the webinar session.
-
#session_key ⇒ Object
sessionKey* integer($int64) The unique key of the webinar session.
-
#start_time ⇒ Object
startTime* string($date-time) The starting time of the webinar session.
-
#webinar_id ⇒ Object
webinarID* string The 9-digit webinar ID.
-
#webinar_key ⇒ Object
webinarKey* integer($int64) The unique key of the webinar.
Constructor Details
#initialize(data) ⇒ Session
Returns a new instance of Session.
5 6 7 |
# File 'lib/go_to_webinar/session.rb', line 5 def initialize(data) @data = data end |
Class Method Details
.all ⇒ Object
59 60 61 |
# File 'lib/go_to_webinar/session.rb', line 59 def self.all make(GoToWebinar.client.get('/organizers/:organizer_key:/sessions')) end |
.find(webinar_key:, session_key:) ⇒ Object
50 51 52 53 |
# File 'lib/go_to_webinar/session.rb', line 50 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
55 56 57 |
# File 'lib/go_to_webinar/session.rb', line 55 def self.for_webinar(webinar_key:) make(GoToWebinar.client.get("/organizers/:organizer_key:/webinars/#{webinar_key}/sessions")) end |
Instance Method Details
#attendees ⇒ Object
Get session attendees
46 47 48 |
# File 'lib/go_to_webinar/session.rb', line 46 def attendees Attendee.all_for_session(webinar_key: webinar_key, session_key: session_key) end |
#end_time ⇒ Object
endTime* string($date-time) The ending time of the webinar session
41 42 43 |
# File 'lib/go_to_webinar/session.rb', line 41 def end_time @data['endTime']&.to_datetime end |
#registrants_attended ⇒ Object
registrantsAttended* integer($int32) The number of registrants who attended the webinar session
17 18 19 |
# File 'lib/go_to_webinar/session.rb', line 17 def registrants_attended @data['registrantsAttended'].to_s end |
#session_key ⇒ Object
sessionKey* integer($int64) The unique key of the webinar session
35 36 37 |
# File 'lib/go_to_webinar/session.rb', line 35 def session_key @data['sessionKey'].to_s end |
#start_time ⇒ Object
startTime* string($date-time) The starting time of the webinar session
11 12 13 |
# File 'lib/go_to_webinar/session.rb', line 11 def start_time @data['startTime']&.to_datetime end |
#webinar_id ⇒ Object
webinarID* string The 9-digit webinar ID
29 30 31 |
# File 'lib/go_to_webinar/session.rb', line 29 def webinar_id @data['webinarID'].to_s end |
#webinar_key ⇒ Object
webinarKey* integer($int64) The unique key of the webinar
23 24 25 |
# File 'lib/go_to_webinar/session.rb', line 23 def webinar_key @data['webinarKey'].to_s end |