Class: WufooParty::Report
Overview
Wraps an individual Wufoo Report.
Instantiation
There are two ways to instantiate a Report object:
-
Via the parent WufooParty object that represents the account.
-
Via the WufooParty::Report class directly.
wufoo = WufooParty.new(ACCOUNT, API_KEY)
report = wufoo.report(REPORT_ID)
# or...
report = WufooParty::Report.new(REPORT_ID, :account => ACCOUNT, :api_key => API_KEY)
The first technique makes a call to the Wufoo API to get the report details, while the second technique lazily loads the report details, once something is accessed via [].
Report Details
Access report details like it is a Hash, e.g.:
report['Name']
Instance Attribute Summary
Attributes inherited from Entity
Instance Method Summary collapse
-
#[](id) ⇒ Object
Access report details.
-
#fields ⇒ Object
Returns field details for the report.
-
#widgets ⇒ Object
Returns widget details for the report.
Methods inherited from Entity
Constructor Details
This class inherits a constructor from WufooParty::Entity
Instance Method Details
#[](id) ⇒ Object
Access report details.
313 314 315 316 |
# File 'lib/wufoo_party.rb', line 313 def [](id) @details ||= @party.report(@id) @details[id] end |
#fields ⇒ Object
Returns field details for the report
319 320 321 |
# File 'lib/wufoo_party.rb', line 319 def fields @party.get("reports/#{@id}/fields")['Fields'] end |
#widgets ⇒ Object
Returns widget details for the report
324 325 326 |
# File 'lib/wufoo_party.rb', line 324 def @party.get("reports/#{@id}/widgets")['Widgets'] end |