Class: Gotenberg::Client
- Inherits:
-
Object
- Object
- Gotenberg::Client
- Defined in:
- lib/gotenberg/client.rb
Instance Attribute Summary collapse
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
Instance Method Summary collapse
- #adapter ⇒ Object
- #default_headers ⇒ Object
-
#initialize(base_path) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(base_path) ⇒ Client
Returns a new instance of Client.
8 9 10 |
# File 'lib/gotenberg/client.rb', line 8 def initialize base_path @base_path = base_path end |
Instance Attribute Details
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
6 7 8 |
# File 'lib/gotenberg/client.rb', line 6 def base_path @base_path end |
Instance Method Details
#adapter ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/gotenberg/client.rb', line 12 def adapter @adapter ||= Faraday.new(base_path, headers: default_headers) do |c| c.request :multipart c.request :url_encoded c.adapter :net_http c.response :raise_error end end |
#default_headers ⇒ Object
21 22 23 |
# File 'lib/gotenberg/client.rb', line 21 def default_headers {'Content-Type' => 'multipart/form-data'} end |