Class: Fortnox::API::Base
- Inherits:
-
Object
- Object
- Fortnox::API::Base
- Extended by:
- ClassMethods
- Includes:
- EnvironmentValidation, RequestHandling, HTTParty
- Defined in:
- lib/fortnox/api/base.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_HEADERS =
{ 'Content-Type' => 'application/json', 'Accept' => 'application/json', }
- HTTP_METHODS =
[ :get, :put, :post, :delete ]
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
Instance Method Summary collapse
-
#initialize ⇒ Base
constructor
A new instance of Base.
Methods included from ClassMethods
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
26 27 28 29 30 31 32 33 |
# File 'lib/fortnox/api/base.rb', line 26 def initialize self.class.base_uri( get_base_url ) self.headers = DEFAULT_HEADERS.merge({ 'Client-Secret' => get_client_secret, 'Access-Token' => get_access_token, }) end |
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers.
24 25 26 |
# File 'lib/fortnox/api/base.rb', line 24 def headers @headers end |