Class: Vpsa::Api::Entities

Inherits:
Client
  • Object
show all
Defined in:
lib/vpsa/api/entities.rb

Instance Attribute Summary

Attributes inherited from Client

#access_token

Instance Method Summary collapse

Methods inherited from Client

#category_levels, #client_classes, #companies, #credit_limits, #default_entries, #entities, #initialize, #installments, #orders, #payment_conditions, #product_categories, #products, #provisions, #receipts, #sales_history, #sellers, #third_parties, #user_data

Methods included from ClassMethods

#require_all

Constructor Details

This class inherits a constructor from Vpsa::Client

Instance Method Details

#find(id) ⇒ Object



15
16
17
# File 'lib/vpsa/api/entities.rb', line 15

def find(id)
  return parse_response(self.class.get("/#{id}", :body => build_body,  :headers => header))
end

#list(searcher = nil) ⇒ Object

Raises:

  • (ArgumentError)


8
9
10
11
12
13
# File 'lib/vpsa/api/entities.rb', line 8

def list(searcher = nil)
  raise ArgumentError unless searcher.nil? || searcher.is_a?(Vpsa::Searcher::Administrative::EntitySearcher)
  
  return parse_response(self.class.get("/", :body => build_body(searcher.as_parameter),  :headers => header)) if searcher
  return parse_response(self.class.get("/", :body => build_body,  :headers => header)) unless searcher
end