Class: Webex::User::Registration
- Inherits:
-
Object
- Object
- Webex::User::Registration
- Includes:
- Webex, Webex::User
- Defined in:
- lib/webex/user/registration.rb
Overview
comment
Constant Summary
Constants included from Webex::User
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.
-
#admin ⇒ Object
Returns the value of attribute admin.
-
#back_url ⇒ Object
Returns the value of attribute back_url.
-
#city ⇒ Object
Returns the value of attribute city.
-
#computer ⇒ Object
Returns the value of attribute computer.
-
#country ⇒ Object
Returns the value of attribute country.
-
#email ⇒ Object
Returns the value of attribute email.
-
#fax_phones ⇒ Object
Returns the value of attribute fax_phones.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#meeting_type ⇒ Object
Returns the value of attribute meeting_type.
-
#new_password ⇒ Object
Returns the value of attribute new_password.
-
#new_webex_id ⇒ Object
Returns the value of attribute new_webex_id.
-
#office_phones ⇒ Object
Returns the value of attribute office_phones.
-
#one_click ⇒ Object
Returns the value of attribute one_click.
-
#partner_id ⇒ Object
Returns the value of attribute partner_id.
-
#partner_link ⇒ Object
Returns the value of attribute partner_link.
-
#password ⇒ Object
Returns the value of attribute password.
-
#password_change ⇒ Object
Returns the value of attribute password_change.
-
#portal ⇒ Object
Returns the value of attribute portal.
-
#state ⇒ Object
Returns the value of attribute state.
-
#storage ⇒ Object
Returns the value of attribute storage.
-
#supports ⇒ Object
Returns the value of attribute supports.
-
#time_zone ⇒ Object
Returns the value of attribute time_zone.
-
#tracking_codes ⇒ Object
Returns the value of attribute tracking_codes.
-
#tsp_bridges ⇒ Object
Returns the value of attribute tsp_bridges.
-
#web_ex_type ⇒ Object
Returns the value of attribute web_ex_type.
-
#webex_id ⇒ Object
Returns the value of attribute webex_id.
-
#zip_code ⇒ Object
Returns the value of attribute zip_code.
Instance Method Summary collapse
- #edit(condition = {}) ⇒ Object
- #generate_params(overwrite_params = {}) ⇒ Object
-
#initialize(attributes = {}) ⇒ Registration
constructor
office_phones = nil, OPhoneArea: nil, OPhoneLocal: nil, OPhoneExt: nil fax_phones = nil, FPhoneArea: nil, FPhoneLocal: nil, FPhoneExt: nil supports = { SupportRecordingEdit: nil, SupportFileFolder: nil, SupportMyContacts: nil, SupportMyProfile: nil, SupportMyMeetings: nil, SupportEndUserReport: nil, SupportAccessAnywhere: nil, SupportMyRecordings: nil, SupportEventDocuments: nil, SupportPersonalLobby: nil} tracking_codes = [nil, nil, nil] tsp_bridges: [nil, TollFreeCallIn: nil, TollCallIn1: nil, ParticipantAccessCode: nil, SubscribeAccessCode: nil, nil, TollFreeCallIn: nil, TollCallIn1: nil, ParticipantAccessCode: nil, SubscribeAccessCode: nil, nil, TollFreeCallIn: nil, TollCallIn1: nil, ParticipantAccessCode: nil, SubscribeAccessCode: nil].
- #sign_up(condition = {}) ⇒ Object
Methods included from Webex::User
Methods included from Webex
#env_attributes!, #option_required!
Constructor Details
#initialize(attributes = {}) ⇒ Registration
office_phones = nil, OPhoneArea: nil, OPhoneLocal: nil, OPhoneExt: nil fax_phones = nil, FPhoneArea: nil, FPhoneLocal: nil, FPhoneExt: nil supports = { SupportRecordingEdit: nil, SupportFileFolder: nil, SupportMyContacts: nil,
SupportMyProfile: nil, SupportMyMeetings: nil, SupportEndUserReport: nil,
SupportAccessAnywhere: nil, SupportMyRecordings: nil, SupportEventDocuments: nil,
SupportPersonalLobby: nil}
tracking_codes = [nil, nil, nil] tsp_bridges: [nil, TollFreeCallIn: nil, TollCallIn1: nil, ParticipantAccessCode: nil, SubscribeAccessCode: nil,
{CreateAccount: nil, TollFreeCallIn: nil, TollCallIn1: nil, ParticipantAccessCode: nil, SubscribeAccessCode: nil},
{CreateAccount: nil, TollFreeCallIn: nil, TollCallIn1: nil, ParticipantAccessCode: nil, SubscribeAccessCode: nil}]
25 26 27 28 29 |
# File 'lib/webex/user/registration.rb', line 25 def initialize(attributes = {}) attributes.each { |k, v| send("#{k}=", v) } env_attributes! option_required! :webex_id, :password, :partner_id end |
Instance Attribute Details
#address_1 ⇒ Object
Returns the value of attribute address_1.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def address_1 @address_1 end |
#address_2 ⇒ Object
Returns the value of attribute address_2.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def address_2 @address_2 end |
#admin ⇒ Object
Returns the value of attribute admin.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def admin @admin end |
#back_url ⇒ Object
Returns the value of attribute back_url.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def back_url @back_url end |
#city ⇒ Object
Returns the value of attribute city.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def city @city end |
#computer ⇒ Object
Returns the value of attribute computer.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def computer @computer end |
#country ⇒ Object
Returns the value of attribute country.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def country @country end |
#email ⇒ Object
Returns the value of attribute email.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def email @email end |
#fax_phones ⇒ Object
Returns the value of attribute fax_phones.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def fax_phones @fax_phones end |
#first_name ⇒ Object
Returns the value of attribute first_name.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def last_name @last_name end |
#meeting_type ⇒ Object
Returns the value of attribute meeting_type.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def meeting_type @meeting_type end |
#new_password ⇒ Object
Returns the value of attribute new_password.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def new_password @new_password end |
#new_webex_id ⇒ Object
Returns the value of attribute new_webex_id.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def new_webex_id @new_webex_id end |
#office_phones ⇒ Object
Returns the value of attribute office_phones.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def office_phones @office_phones end |
#one_click ⇒ Object
Returns the value of attribute one_click.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def one_click @one_click end |
#partner_id ⇒ Object
Returns the value of attribute partner_id.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def partner_id @partner_id end |
#partner_link ⇒ Object
Returns the value of attribute partner_link.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def partner_link @partner_link end |
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def password @password end |
#password_change ⇒ Object
Returns the value of attribute password_change.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def password_change @password_change end |
#portal ⇒ Object
Returns the value of attribute portal.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def portal @portal end |
#state ⇒ Object
Returns the value of attribute state.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def state @state end |
#storage ⇒ Object
Returns the value of attribute storage.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def storage @storage end |
#supports ⇒ Object
Returns the value of attribute supports.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def supports @supports end |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def time_zone @time_zone end |
#tracking_codes ⇒ Object
Returns the value of attribute tracking_codes.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def tracking_codes @tracking_codes end |
#tsp_bridges ⇒ Object
Returns the value of attribute tsp_bridges.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def tsp_bridges @tsp_bridges end |
#web_ex_type ⇒ Object
Returns the value of attribute web_ex_type.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def web_ex_type @web_ex_type end |
#webex_id ⇒ Object
Returns the value of attribute webex_id.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def webex_id @webex_id end |
#zip_code ⇒ Object
Returns the value of attribute zip_code.
8 9 10 |
# File 'lib/webex/user/registration.rb', line 8 def zip_code @zip_code end |
Instance Method Details
#edit(condition = {}) ⇒ Object
37 38 39 40 41 |
# File 'lib/webex/user/registration.rb', line 37 def edit(condition={}) option_required! :webex_id, :password, :partner_id res = Net::HTTP.post_form post_url, generate_params(api_type: 'EU') Hash[res.body.stringify_string.split('&').map! { |i| i.split('=') }] end |
#generate_params(overwrite_params = {}) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/webex/user/registration.rb', line 43 def generate_params(overwrite_params = {}) result = {} result[:AT] = overwrite_params[:api_type] result[:PW] = password result[:PID] = partner_id result[:WID] = webex_id result[:Address1] = address_1 result[:Address2] = address_2 result[:City] = city result[:State] = state result[:ZipCode] = zip_code result[:Country] = country result[:AC] = computer result[:AS] = storage result[:LA] = admin result[:MW] = web_ex_type result[:PL] = partner_link result[:PT] = portal result[:MT] = meeting_type result[:TimeZone] = time_zone result[:BU] = back_url result[:OC] = one_click if result[:AT] == 'SU' result[:FN] = first_name result[:LN] = last_name result[:EM] = email result[:ForceChangeUserPwd] = password_change end if result[:AT] == 'EU' result[:NFN] = first_name result[:NLN] = last_name result[:NEM] = email result[:NPW] = new_password result[:NWID] = new_webex_id end merge_hash!(result) end |
#sign_up(condition = {}) ⇒ Object
31 32 33 34 35 |
# File 'lib/webex/user/registration.rb', line 31 def sign_up(condition={}) option_required! :webex_id, :first_name, :last_name, :email, :password, :partner_id res = Net::HTTP.post_form post_url, generate_params(api_type: 'SU') Hash[res.body.stringify_string.split('&').map! { |i| i.split('=') }] end |