Module: ChartMogul::API::Actions::All::ClassMethods
- Defined in:
- lib/chartmogul/api/actions/all.rb
Instance Method Summary collapse
Instance Method Details
#all(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/chartmogul/api/actions/all.rb', line 10 def all( = {}) resp = handling_errors do connection.get(resource_path.apply_with_get_params()) do |req| req.headers['Content-Type'] = 'application/json' end end json = ChartMogul::Utils::JSONParser.parse(resp.body) if resource_root_key && json.key?(resource_root_key) json[resource_root_key].map { |attributes| new_from_json(attributes) } else new_from_json(json) end end |