Class: PactasItero::Client
- Inherits:
-
Object
- Object
- PactasItero::Client
- Includes:
- Api, Configurable
- Defined in:
- lib/pactas_itero/client.rb
Constant Summary collapse
- LEGAL_ENTITY_HEADER_FIELD =
"X-SELECTED-LEGAL-ENTITY-ID"
Instance Attribute Summary collapse
-
#bearer_token ⇒ Object
Returns the value of attribute bearer_token.
Attributes included from Configurable
#api_endpoint, #client_id, #client_secret, #default_media_type, #legal_entity_id, #middleware, #production, #user_agent
Instance Method Summary collapse
- #bearer_token? ⇒ Boolean
- #delete(url, options = {}) ⇒ Object
- #get(url, options = {}) ⇒ Object
- #head(url, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #patch(url, options = {}) ⇒ Object
- #post(url, options = {}) ⇒ Object
- #put(url, options = {}) ⇒ Object
Methods included from Api::PaymentTransactions
Methods included from Api::Invoices
#invoice, #invoice_download, #invoices, #invoices_from
Methods included from Api::Orders
#commit_order, #create_order, #order
Methods included from Api::Contracts
#contract, #contract_cancellation_preview, #contract_changes, #contract_metered_usage, #contracts, #customer_contracts, #get_self_service_token_for_contract, #terminate_contract, #update_contract
Methods included from Api::Customers
#create_customer, #customer, #customers, #update_customer
Methods included from Api::RatedItems
#create_rated_item, #delete_rated_item, #rated_items
Methods included from Api::OAuth
Methods included from Configurable
#configure, keys, #production_api_endpoint, #reset!, #sandbox_api_endpoint
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
17 18 19 20 21 22 23 24 |
# File 'lib/pactas_itero/client.rb', line 17 def initialize( = {}) PactasItero::Configurable.keys.each do |key| instance_variable_set( :"@#{key}", [key] || PactasItero.instance_variable_get(:"@#{key}") ) end end |
Instance Attribute Details
#bearer_token ⇒ Object
Returns the value of attribute bearer_token.
15 16 17 |
# File 'lib/pactas_itero/client.rb', line 15 def bearer_token @bearer_token end |
Instance Method Details
#bearer_token? ⇒ Boolean
50 51 52 |
# File 'lib/pactas_itero/client.rb', line 50 def bearer_token? !!bearer_token end |
#delete(url, options = {}) ⇒ Object
42 43 44 |
# File 'lib/pactas_itero/client.rb', line 42 def delete(url, = {}) request :delete, url, end |
#get(url, options = {}) ⇒ Object
26 27 28 |
# File 'lib/pactas_itero/client.rb', line 26 def get(url, = {}) request :get, url, end |
#head(url, options = {}) ⇒ Object
46 47 48 |
# File 'lib/pactas_itero/client.rb', line 46 def head(url, = {}) request :head, url, end |
#patch(url, options = {}) ⇒ Object
38 39 40 |
# File 'lib/pactas_itero/client.rb', line 38 def patch(url, = {}) request :patch, url, end |
#post(url, options = {}) ⇒ Object
30 31 32 |
# File 'lib/pactas_itero/client.rb', line 30 def post(url, = {}) request :post, url, end |
#put(url, options = {}) ⇒ Object
34 35 36 |
# File 'lib/pactas_itero/client.rb', line 34 def put(url, = {}) request :put, url, end |