Class: Agris::Client
- Inherits:
-
Object
- Object
- Agris::Client
- Includes:
- Api::AccountsPayables::Vouchers, Api::AccountsReceivables::Invoices, Api::Grain::CommodityCodes, Api::Grain::GrainModule, Api::Grain::PurchaseContracts, Api::Grain::SalesContracts, Api::Grain::Tickets, Api::Inventory::DeliveryTickets, Api::Inventory::Orders, Api::Support
- Defined in:
- lib/agris/client.rb
Instance Method Summary collapse
-
#initialize(context = Agris.context, credentials = Agris.credentials, options = {}, dataset:) ⇒ Client
constructor
Initializes the client.
- #log(message) ⇒ Object
Methods included from Api::Support
#build_response, #context_hash, #create_post_payload_xml, #extract_documents, #import, #post_input_hash
Methods included from Api::Inventory::Orders
#create_order, #order, #orders, #orders_changed_since
Methods included from Api::Inventory::DeliveryTickets
#delivery_ticket, #delivery_tickets, #delivery_tickets_changed_since
Methods included from Api::Grain::Tickets
Methods included from Api::Grain::SalesContracts
#sales_contract, #sales_contracts, #sales_contracts_changed_since
Methods included from Api::Grain::PurchaseContracts
#purchase_contract, #purchase_contracts, #purchase_contracts_changed_since
Methods included from Api::Grain::GrainModule
Methods included from Api::Grain::CommodityCodes
#commodity_code, #commodity_codes
Methods included from Api::AccountsReceivables::Invoices
#create_invoice, #invoice, #invoices, #invoices_changed_since
Methods included from Api::AccountsPayables::Vouchers
Constructor Details
#initialize(context = Agris.context, credentials = Agris.credentials, options = {}, dataset:) ⇒ Client
Initializes the client
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/agris/client.rb', line 18 def initialize( context = Agris.context, credentials = Agris.credentials, = {}, dataset: ) @context = context @logger = [:logger] || Agris.logger @log_level = [:log_level] || Agris.log_level @request_type = [:request_type] || Agris.request_type @proxy_url = .fetch(:proxy_url, Agris.proxy_url) @dataset = dataset || Agris.context.default_dataset @request = @request_type.new( @context.base_url, credentials, @logger, @log_level, @proxy_url ) end |
Instance Method Details
#log(message) ⇒ Object
35 36 37 |
# File 'lib/agris/client.rb', line 35 def log() logger.info() end |