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.
3 4 5 |
# File 'lib/go_to_webinar/session.rb', line 3 def initialize(data) @data = data end |
Class Method Details
.all ⇒ Object
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 |
Instance Method Details
#attendees ⇒ Object
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_time ⇒ Object
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_attended ⇒ Object
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_key ⇒ Object
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_time ⇒ Object
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_id ⇒ Object
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_key ⇒ Object
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 |