Class: GoToWebinar::Attendee

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Attendee

Returns a new instance of Attendee.



5
6
7
# File 'lib/go_to_webinar/attendee.rb', line 5

def initialize(data)
  @data = data
end

Class Method Details

.all_for_session(webinar_key:, session_key:) ⇒ Object



45
46
47
# File 'lib/go_to_webinar/attendee.rb', line 45

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

.make(data) ⇒ Object



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

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

Instance Method Details

#attendanceObject



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

def attendance
  @data['attendance']
end

#attendance_time_in_secondsObject



25
26
27
# File 'lib/go_to_webinar/attendee.rb', line 25

def attendance_time_in_seconds
  @data['attendanceTimeInSeconds'].to_s
end

#emailObject



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

def email
  @data['email'].to_s
end

#first_nameObject



13
14
15
# File 'lib/go_to_webinar/attendee.rb', line 13

def first_name
  @data['firstName'].to_s
end

#join_timeObject



37
38
39
# File 'lib/go_to_webinar/attendee.rb', line 37

def join_time
  attendance['joinTime'].to_datetime
end

#last_nameObject



17
18
19
# File 'lib/go_to_webinar/attendee.rb', line 17

def last_name
  @data['lastName'].to_s
end

#leave_timeObject



41
42
43
# File 'lib/go_to_webinar/attendee.rb', line 41

def leave_time
  attendance['leaveTime'].to_datetime
end

#registrant_keyObject



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

def registrant_key
  @data['registrantKey'].to_s
end

#session_keyObject



29
30
31
# File 'lib/go_to_webinar/attendee.rb', line 29

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