Class: FulfilApi::Client
- Inherits:
 - 
      Object
      
        
- Object
 - FulfilApi::Client
 
 
- Defined in:
 - lib/fulfil_api/client.rb
 
Instance Method Summary collapse
- 
  
    
      #delete(relative_path)  ⇒ Array, ... 
    
    
  
  
  
  
  
  
  
  
  
    
Performs an HTTP DELETE request to a Fulfil API endpoint.
 - 
  
    
      #get(relative_path, url_parameters: nil)  ⇒ Array, ... 
    
    
  
  
  
  
  
  
  
  
  
    
Performs an HTTP GET request to a Fulfil API endpoint.
 - 
  
    
      #initialize(configuration)  ⇒ Client 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Client.
 - 
  
    
      #post(relative_path, body: {})  ⇒ Array, ... 
    
    
  
  
  
  
  
  
  
  
  
    
Performs an HTTP POST request to a Fulfil API endpoint.
 - 
  
    
      #put(relative_path, body: nil)  ⇒ Array, ... 
    
    
  
  
  
  
  
  
  
  
  
    
Performs an HTTP PUT request to a Fulfil API endpoint.
 
Constructor Details
#initialize(configuration) ⇒ Client
Returns a new instance of Client.
      9 10 11  | 
    
      # File 'lib/fulfil_api/client.rb', line 9 def initialize(configuration) @configuration = configuration end  | 
  
Instance Method Details
#delete(relative_path) ⇒ Array, ...
Performs an HTTP DELETE request to a Fulfil API endpoint.
      17 18 19  | 
    
      # File 'lib/fulfil_api/client.rb', line 17 def delete(relative_path) request(:delete, relative_path) end  | 
  
#get(relative_path, url_parameters: nil) ⇒ Array, ...
Performs an HTTP GET request to a Fulfil API endpoint.
      26 27 28  | 
    
      # File 'lib/fulfil_api/client.rb', line 26 def get(relative_path, url_parameters: nil) request(:get, relative_path, url_parameters) end  | 
  
#post(relative_path, body: {}) ⇒ Array, ...
Performs an HTTP POST request to a Fulfil API endpoint.
      35 36 37  | 
    
      # File 'lib/fulfil_api/client.rb', line 35 def post(relative_path, body: {}) request(:post, relative_path, body) end  | 
  
#put(relative_path, body: nil) ⇒ Array, ...
Performs an HTTP PUT request to a Fulfil API endpoint.
      44 45 46 47 48  | 
    
      # File 'lib/fulfil_api/client.rb', line 44 def put(relative_path, body: nil) return request(:put, relative_path) if body.nil? request(:put, relative_path, body) end  |