Class: Webex::Meeting::Registration
- Inherits:
-
Object
- Object
- Webex::Meeting::Registration
- Includes:
- Webex, Webex::Meeting
- Defined in:
- lib/webex/meeting/registration.rb
Overview
comment
Constant Summary
Constants included from Webex::Meeting
Constants included from Webex
Instance Attribute Summary collapse
-
#address_1 ⇒ Object
Returns the value of attribute address_1.
-
#address_2 ⇒ Object
Returns the value of attribute address_2.
-
#back_url ⇒ Object
Returns the value of attribute back_url.
-
#check_box_contents ⇒ Object
Returns the value of attribute check_box_contents.
-
#city ⇒ Object
Returns the value of attribute city.
-
#computer_name ⇒ Object
Returns the value of attribute computer_name.
-
#country ⇒ Object
Returns the value of attribute country.
-
#dropdown_list_selections ⇒ Object
Returns the value of attribute dropdown_list_selections.
-
#email_address ⇒ Object
Returns the value of attribute email_address.
-
#fax ⇒ Object
Returns the value of attribute fax.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#job_title ⇒ Object
Returns the value of attribute job_title.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#meeting_key ⇒ Object
Returns the value of attribute meeting_key.
-
#name_and_values ⇒ Object
Returns the value of attribute name_and_values.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#radio_button_contents ⇒ Object
Returns the value of attribute radio_button_contents.
-
#state ⇒ Object
Returns the value of attribute state.
-
#text_box_contents ⇒ Object
Returns the value of attribute text_box_contents.
-
#zip_code ⇒ Object
Returns the value of attribute zip_code.
Instance Method Summary collapse
- #form ⇒ Object
- #generate_params(overwrite_params = {}) ⇒ Object
-
#initialize(attributes = {}) ⇒ Registration
constructor
A new instance of Registration.
- #register ⇒ Object
Methods included from Webex::Meeting
Methods included from Webex
#env_attributes!, #option_required!
Constructor Details
#initialize(attributes = {}) ⇒ Registration
Returns a new instance of Registration.
12 13 14 15 16 |
# File 'lib/webex/meeting/registration.rb', line 12 def initialize(attributes = {}) attributes.each { |k, v| send("#{k}=", v) } env_attributes! option_required! :back_url end |
Instance Attribute Details
#address_1 ⇒ Object
Returns the value of attribute address_1.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def address_1 @address_1 end |
#address_2 ⇒ Object
Returns the value of attribute address_2.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def address_2 @address_2 end |
#back_url ⇒ Object
Returns the value of attribute back_url.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def back_url @back_url end |
#check_box_contents ⇒ Object
Returns the value of attribute check_box_contents.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def check_box_contents @check_box_contents end |
#city ⇒ Object
Returns the value of attribute city.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def city @city end |
#computer_name ⇒ Object
Returns the value of attribute computer_name.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def computer_name @computer_name end |
#country ⇒ Object
Returns the value of attribute country.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def country @country end |
#dropdown_list_selections ⇒ Object
Returns the value of attribute dropdown_list_selections.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def dropdown_list_selections @dropdown_list_selections end |
#email_address ⇒ Object
Returns the value of attribute email_address.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def email_address @email_address end |
#fax ⇒ Object
Returns the value of attribute fax.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def fax @fax end |
#first_name ⇒ Object
Returns the value of attribute first_name.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def first_name @first_name end |
#job_title ⇒ Object
Returns the value of attribute job_title.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def job_title @job_title end |
#last_name ⇒ Object
Returns the value of attribute last_name.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def last_name @last_name end |
#meeting_key ⇒ Object
Returns the value of attribute meeting_key.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def meeting_key @meeting_key end |
#name_and_values ⇒ Object
Returns the value of attribute name_and_values.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def name_and_values @name_and_values end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def phone_number @phone_number end |
#radio_button_contents ⇒ Object
Returns the value of attribute radio_button_contents.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def @radio_button_contents end |
#state ⇒ Object
Returns the value of attribute state.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def state @state end |
#text_box_contents ⇒ Object
Returns the value of attribute text_box_contents.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def text_box_contents @text_box_contents end |
#zip_code ⇒ Object
Returns the value of attribute zip_code.
7 8 9 |
# File 'lib/webex/meeting/registration.rb', line 7 def zip_code @zip_code end |
Instance Method Details
#form ⇒ Object
18 19 20 21 22 |
# File 'lib/webex/meeting/registration.rb', line 18 def form option_required! :meeting_key res = Net::HTTP.post_form post_url, generate_params(api_type: 'GF') Hash[res.body.stringify_string.split('&').map! { |i| i.split('=') }] end |
#generate_params(overwrite_params = {}) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/webex/meeting/registration.rb', line 30 def generate_params(overwrite_params = {}) result = {} result[:AT] = overwrite_params[:api_type] result[:MK] = meeting_key result[:BU] = back_url if result[:AT] == 'RM' result[:FN] = first_name result[:LN] = last_name result[:EM] = email_address result[:JT] = job_title result[:CY] = computer_name result[:E1] = address_1 result[:E2] = address_2 result[:CT] = city result[:SA] = state result[:ZP] = zip_code result[:CI] = country result[:PH] = phone_number result[:FX] = fax result.merge!(name_and_value_params) if name_and_values result.merge!(tc_params) end result.delete_if { |k, v| v.nil? } end |
#register ⇒ Object
24 25 26 27 28 |
# File 'lib/webex/meeting/registration.rb', line 24 def register option_required! :meeting_key, :first_name, :last_name, :email_address, :job_title, :computer_name res = Net::HTTP.post_form post_url, generate_params(api_type: 'RM') Hash[res.body.stringify_string.split('&').map! { |i| i.split('=') }] end |