Sha256: 7510ef796a6d0a8203e67b47751e4eccce2a90cf57310fa575b284b700811e1d

Contents?: true

Size: 668 Bytes

Versions: 4

Compression:

Stored size: 668 Bytes

Contents

# frozen_string_literal: true

module ChartMogul
  module API
    module Actions
      module Retrieve
        def self.included(base)
          base.extend ClassMethods
        end

        module ClassMethods
          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, skip_case_conversion: skip_case_conversion)
            new_from_json(json)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chartmogul-ruby-1.7.1 lib/chartmogul/api/actions/retrieve.rb
chartmogul-ruby-1.6.9 lib/chartmogul/api/actions/retrieve.rb
chartmogul-ruby-1.6.8 lib/chartmogul/api/actions/retrieve.rb
chartmogul-ruby-1.6.7 lib/chartmogul/api/actions/retrieve.rb