class Print::Client

Public Class Methods

new(options={}) click to toggle source
# File lib/print/client.rb, line 13
def initialize(options={})
  merged_options = Print.options.merge(options)
  Configuration::VALID_CONFIG_KEYS.each do |key|
    send("#{key}=", merged_options[key])
  end
end

Private Class Methods

create(resource, hash) click to toggle source
# File lib/print/client.rb, line 40
def self.create(resource, hash)
  self.post('/' + resource.to_s, hash, headers: headers)
end
get_by_id(resource, id) click to toggle source
# File lib/print/client.rb, line 36
def self.get_by_id(resource, id)
  self.get('/' + resource.to_s + '/' + id, headers: headers)
end
get_list(resource) click to toggle source
# File lib/print/client.rb, line 32
def self.get_list(resource)
  self.get('/' + resource.to_s, headers: headers)
end

Private Instance Methods

headers() click to toggle source
# File lib/print/client.rb, line 24
def headers
  {
    "User-Agent" => self.user_agent,
    "Accept" => "application/io.tmd.v#{self.api_version}",
    "Authorization" => "Token token=\"#{self.api_key}\""
  }
end