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.



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

def initialize(data)
  @data = data
end

Class Method Details

.all_for_session(webinar_key:, session_key:) ⇒ Object



43
44
45
# File 'lib/go_to_webinar/attendee.rb', line 43

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



47
48
49
# File 'lib/go_to_webinar/attendee.rb', line 47

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

Instance Method Details

#attendanceObject



31
32
33
# File 'lib/go_to_webinar/attendee.rb', line 31

def attendance
  @data['attendance']
end

#attendance_time_in_secondsObject



23
24
25
# File 'lib/go_to_webinar/attendee.rb', line 23

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

#emailObject



19
20
21
# File 'lib/go_to_webinar/attendee.rb', line 19

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

#first_nameObject



11
12
13
# File 'lib/go_to_webinar/attendee.rb', line 11

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

#join_timeObject



35
36
37
# File 'lib/go_to_webinar/attendee.rb', line 35

def join_time
  attendance['joinTime'].to_datetime
end

#last_nameObject



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

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

#leave_timeObject



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

def leave_time
  attendance['leaveTime'].to_datetime
end

#registrant_keyObject



7
8
9
# File 'lib/go_to_webinar/attendee.rb', line 7

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

#session_keyObject



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

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