Class: Webex::Meeting::Presenter
- Inherits:
-
Object
- Object
- Webex::Meeting::Presenter
- Includes:
- Webex, Webex::Meeting
- Defined in:
- lib/webex/meeting/presenter.rb
Overview
comment
Constant Summary
Constants included from Webex::Meeting
Constants included from Webex
Instance Attribute Summary collapse
-
#back_url ⇒ Object
Returns the value of attribute back_url.
-
#cancel_mail ⇒ Object
Returns the value of attribute cancel_mail.
-
#email ⇒ Object
Returns the value of attribute email.
-
#full_name ⇒ Object
Returns the value of attribute full_name.
-
#invitation ⇒ Object
Returns the value of attribute invitation.
-
#meeting_key ⇒ Object
Returns the value of attribute meeting_key.
-
#phones ⇒ Object
Returns the value of attribute phones.
Instance Method Summary collapse
- #add ⇒ Object
- #delete ⇒ Object
- #generate_params(overwrite_params = {}) ⇒ Object
-
#initialize(attributes = {}) ⇒ Presenter
constructor
phones = nil, PhoneArea: nil, PhoneNumber: nil, PhoneExt: nil.
Methods included from Webex::Meeting
Methods included from Webex
#env_attributes!, #option_required!
Constructor Details
#initialize(attributes = {}) ⇒ Presenter
phones = nil, PhoneArea: nil, PhoneNumber: nil, PhoneExt: nil
11 12 13 14 15 |
# File 'lib/webex/meeting/presenter.rb', line 11 def initialize(attributes = {}) attributes.each { |k, v| send("#{k}=", v) } env_attributes! option_required! :back_url end |
Instance Attribute Details
#back_url ⇒ Object
Returns the value of attribute back_url.
7 8 9 |
# File 'lib/webex/meeting/presenter.rb', line 7 def back_url @back_url end |
#cancel_mail ⇒ Object
Returns the value of attribute cancel_mail.
7 8 9 |
# File 'lib/webex/meeting/presenter.rb', line 7 def cancel_mail @cancel_mail end |
#email ⇒ Object
Returns the value of attribute email.
7 8 9 |
# File 'lib/webex/meeting/presenter.rb', line 7 def email @email end |
#full_name ⇒ Object
Returns the value of attribute full_name.
7 8 9 |
# File 'lib/webex/meeting/presenter.rb', line 7 def full_name @full_name end |
#invitation ⇒ Object
Returns the value of attribute invitation.
7 8 9 |
# File 'lib/webex/meeting/presenter.rb', line 7 def invitation @invitation end |
#meeting_key ⇒ Object
Returns the value of attribute meeting_key.
7 8 9 |
# File 'lib/webex/meeting/presenter.rb', line 7 def meeting_key @meeting_key end |
#phones ⇒ Object
Returns the value of attribute phones.
7 8 9 |
# File 'lib/webex/meeting/presenter.rb', line 7 def phones @phones end |
Instance Method Details
#add ⇒ Object
17 18 19 20 21 22 |
# File 'lib/webex/meeting/presenter.rb', line 17 def add option_required! :full_name res = Net::HTTP.post_form post_url, generate_params(api_type: 'AP') p res.body Hash[res.body.stringify_string.split('&').map! { |i| i.split('=') }] end |
#delete ⇒ Object
24 25 26 27 28 |
# File 'lib/webex/meeting/presenter.rb', line 24 def delete res = Net::HTTP.post_form post_url, generate_params(api_type: 'DP') p res.body 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 |
# File 'lib/webex/meeting/presenter.rb', line 30 def generate_params(overwrite_params = {}) result = {} result[:AT] = overwrite_params[:api_type] result[:MK] = meeting_key result[:BU] = back_url result[:FN] = full_name result[:EM] = email if result[:AT] == 'AP' result[:EI] = invitation result.merge!(phone_params) if phones end result[:EC] = cancel_mail? if result[:AT] == 'DP' result.delete_if { |k, v| v.nil? } end |