Module: Fakturoid::Connection
- Included in:
- Request
- Defined in:
- lib/fakturoid/connection.rb
Instance Method Summary collapse
Instance Method Details
#connection(options = {}) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/fakturoid/connection.rb', line 15 def connection( = {}) @connection = Faraday.new () @connection.basic_auth(Fakturoid::Api.config.email, Fakturoid::Api.config.api_key) @connection end |
#default_options(options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/fakturoid/connection.rb', line 4 def ( = {}) content_type = [:headers] && [:headers][:content_type] { headers: { content_type: content_type || 'application/json', user_agent: Fakturoid::Api.config.user_agent }, url: [:url] || Fakturoid::Api.config.endpoint } end |