Class: Webex::User::Report
- Inherits:
-
Object
- Object
- Webex::User::Report
- Includes:
- Webex, Webex::User
- Defined in:
- lib/webex/user/report.rb
Overview
comment
Constant Summary
Constants included from Webex::User
Constants included from Webex
Instance Attribute Summary collapse
-
#back_url ⇒ Object
Returns the value of attribute back_url.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#end_month ⇒ Object
Returns the value of attribute end_month.
-
#end_year ⇒ Object
Returns the value of attribute end_year.
-
#report_type ⇒ Object
Returns the value of attribute report_type.
-
#sort_result_by ⇒ Object
Returns the value of attribute sort_result_by.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#start_month ⇒ Object
Returns the value of attribute start_month.
-
#start_year ⇒ Object
Returns the value of attribute start_year.
-
#topic ⇒ Object
Returns the value of attribute topic.
Instance Method Summary collapse
- #display ⇒ Object
- #generate_params(overwrite_params = {}) ⇒ Object
-
#initialize(attributes = {}) ⇒ Report
constructor
A new instance of Report.
Methods included from Webex::User
Methods included from Webex
#env_attributes!, #option_required!
Constructor Details
#initialize(attributes = {}) ⇒ Report
Returns a new instance of Report.
10 11 12 13 14 |
# File 'lib/webex/user/report.rb', line 10 def initialize(attributes = {}) attributes.each { |k, v| send("#{k}=", v) } env_attributes! option_required! :report_type, :back_url end |
Instance Attribute Details
#back_url ⇒ Object
Returns the value of attribute back_url.
7 8 9 |
# File 'lib/webex/user/report.rb', line 7 def back_url @back_url end |
#end_date ⇒ Object
Returns the value of attribute end_date.
7 8 9 |
# File 'lib/webex/user/report.rb', line 7 def end_date @end_date end |
#end_month ⇒ Object
Returns the value of attribute end_month.
7 8 9 |
# File 'lib/webex/user/report.rb', line 7 def end_month @end_month end |
#end_year ⇒ Object
Returns the value of attribute end_year.
7 8 9 |
# File 'lib/webex/user/report.rb', line 7 def end_year @end_year end |
#report_type ⇒ Object
Returns the value of attribute report_type.
7 8 9 |
# File 'lib/webex/user/report.rb', line 7 def report_type @report_type end |
#sort_result_by ⇒ Object
Returns the value of attribute sort_result_by.
7 8 9 |
# File 'lib/webex/user/report.rb', line 7 def sort_result_by @sort_result_by end |
#start_date ⇒ Object
Returns the value of attribute start_date.
7 8 9 |
# File 'lib/webex/user/report.rb', line 7 def start_date @start_date end |
#start_month ⇒ Object
Returns the value of attribute start_month.
7 8 9 |
# File 'lib/webex/user/report.rb', line 7 def start_month @start_month end |
#start_year ⇒ Object
Returns the value of attribute start_year.
7 8 9 |
# File 'lib/webex/user/report.rb', line 7 def start_year @start_year end |
#topic ⇒ Object
Returns the value of attribute topic.
7 8 9 |
# File 'lib/webex/user/report.rb', line 7 def topic @topic end |
Instance Method Details
#display ⇒ Object
16 17 18 19 |
# File 'lib/webex/user/report.rb', line 16 def display res = Net::HTTP.post_form post_url, generate_params(api_type: 'QR') Hash[res.body.stringify_string.split('&').map! { |i| i.split('=') }] end |
#generate_params(overwrite_params = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/webex/user/report.rb', line 21 def generate_params(overwrite_params = {}) result = {} result[:AT] = overwrite_params[:api_type] result[:BU] = back_url result[:StartMO] = start_month result[:StartYE] = start_year result[:StartDA] = start_date result[:EndMO] = end_month result[:EndYE] = end_year result[:EndDA] = end_date result[:TC] = topic result[:SB] = sort_result_by result.delete_if { |k, v| v.nil? } end |