Class: Postmaster::Package

Inherits:
APIResource show all
Includes:
APIOperations::List
Defined in:
lib/postmaster/package.rb

Class Method Summary collapse

Methods included from APIOperations::List

included

Methods inherited from APIResource

class_name, #refresh, retrieve, url, #url

Methods inherited from PostmasterObject

#[], #[]=, construct_from, #delete, #each, #has_key?, #initialize, #inspect, #keys, #refresh_from, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from Postmaster::PostmasterObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Postmaster::PostmasterObject

Class Method Details

.create(params = {}) ⇒ Object



6
7
8
9
# File 'lib/postmaster/package.rb', line 6

def self.create(params={})
  response = Postmaster.request(:post, self.url, params)
  response[:id]
end

.fit(params = {}) ⇒ Object



11
12
13
14
15
# File 'lib/postmaster/package.rb', line 11

def self.fit(params={})
  json_params = Postmaster::JSON.dump(params, :pretty => true)
  headers = {:content_type => 'application/json'}
  Postmaster.request(:post, '/v1/packages/fit', json_params, headers)
end