Class: StarRezReport
- Includes:
- HTTParty
- Defined in:
- lib/starrez_api/star_rez_report.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#results ⇒ Object
Returns the value of attribute results.
Class Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/starrez_api/star_rez_report.rb', line 7 def name @name end |
#results ⇒ Object
Returns the value of attribute results.
7 8 9 |
# File 'lib/starrez_api/star_rez_report.rb', line 7 def results @results end |
Class Method Details
.find_by_id(entry, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/starrez_api/star_rez_report.rb', line 9 def self.find_by_id(entry, = {}) if entry.blank? raise IOError, "Must include a report ID to search" end conditions = [:conditions].blank? ? '' : "?#{self.get_condition_string([:conditions])}" url = "#{base_uri}/getreportbyid/#{entry}.xml/#{conditions}" response = get(url) if [:return].eql? :response return response else return self.parse_response(response) end end |
.find_by_name(name, options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/starrez_api/star_rez_report.rb', line 23 def self.find_by_name(name, = {}) if name.blank? raise IOError, "Must include a report name" end conditions = [:conditions].blank? ? '' : "?#{self.get_condition_string([:conditions])}" url = "#{base_uri}/getreportbyname/#{URI::escape(name.to_s)}.xml/#{conditions}" response = get(url) if [:return].eql? :response return response else return self.parse_response(response) end end |