Module: ChartMogul::API::Actions::Retrieve::ClassMethods

Defined in:
lib/chartmogul/api/actions/retrieve.rb

Instance Method Summary collapse

Instance Method Details

#retrieve(uuid, options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/chartmogul/api/actions/retrieve.rb', line 12

def retrieve(uuid, options = {})
  resp = handling_errors do
    connection.get("#{resource_path.apply(options)}/#{uuid}") do |req|
      req.headers['Content-Type'] = 'application/json'
    end
  end

  json = ChartMogul::Utils::JSONParser.parse(resp.body, immutable_keys: immutable_keys)
  new_from_json(json)
end