Class: Webex::Meeting::Attendee

Inherits:
Object
  • Object
show all
Includes:
Webex, Webex::Meeting
Defined in:
lib/webex/meeting/attendee.rb

Overview

comment

Constant Summary

Constants included from Webex::Meeting

PATH_URL

Constants included from Webex

CONFIGURATION, VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Webex::Meeting

#post_url

Methods included from Webex

#env_attributes!, #option_required!

Constructor Details

#initialize(attributes = {}) ⇒ Attendee

attendees: [FullName1, EmailAddress: nil, PhoneCountry: nil, PhoneArea: nil, PhoneLocal: nil, PhoneExt: nil, TimeZone: nil, Language: nil, Locale: nil, AddToAddressBook: nil,

{FullName: FullName1, EmailAddress: nil, PhoneCountry: nil, PhoneArea: nil, PhoneLocal: nil, PhoneExt: nil, TimeZone: nil, Language: nil, Locale: nil, AddToAddressBook: nil},
{FullName: FullName1, EmailAddress: nil, PhoneCountry: nil, PhoneArea: nil, PhoneLocal: nil, PhoneExt: nil, TimeZone: nil, Language: nil, Locale: nil, AddToAddressBook: nil}]


12
13
14
15
16
# File 'lib/webex/meeting/attendee.rb', line 12

def initialize(attributes = {})
  attributes.each { |k, v| send("#{k}=", v) }
  env_attributes!
  option_required! :back_url, :meeting_key
end

Instance Attribute Details

#attendeesObject

Returns the value of attribute attendees.



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

def attendees
  @attendees
end

#back_urlObject

Returns the value of attribute back_url.



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

def back_url
  @back_url
end

#cancel_mailObject

Returns the value of attribute cancel_mail.



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

def cancel_mail
  @cancel_mail
end

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

#invitationObject

Returns the value of attribute invitation.



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

def invitation
  @invitation
end

#meeting_keyObject

Returns the value of attribute meeting_key.



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

def meeting_key
  @meeting_key
end

Instance Method Details

#addObject



18
19
20
21
22
# File 'lib/webex/meeting/attendee.rb', line 18

def add
  option_required! :attendees
  res = Net::HTTP.post_form post_url, generate_params(api_type: 'AA')
  Hash[res.body.stringify_string.split('&').map! { |i| i.split('=') }]
end

#deleteObject



24
25
26
27
28
# File 'lib/webex/meeting/attendee.rb', line 24

def delete
  option_required! :email
  res = Net::HTTP.post_form post_url, generate_params(api_type: 'DA')
  Hash[res.body.stringify_string.split('&').map! { |i| i.split('=') }]
end

#detailObject



30
31
32
33
34
# File 'lib/webex/meeting/attendee.rb', line 30

def detail
  option_required! :email
  res = Net::HTTP.post_form post_url, generate_params(api_type: 'MD')
  Hash[res.body.stringify_string.split('&').map! { |i| i.split('=') }]
end

#generate_params(overwrite_params = {}) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/webex/meeting/attendee.rb', line 36

def generate_params(overwrite_params = {})
  result = {}
  result[:AT] = overwrite_params[:api_type]
  result[:MK] = meeting_key
  result[:BU] = back_url
  result[:EM] = email
  result[:EI] = invitation
  result.merge!(attendees_hash) if  result[:AT] == 'AA'
  result[:EC] = cancel_mail? if result[:AT] == 'DA'
  result.delete_if { |k, v| v.nil? }
end