Class: Html2img::Configuration
- Inherits:
-
Object
- Object
- Html2img::Configuration
- Defined in:
- lib/html2img/configuration.rb
Overview
Instance Attribute Summary collapse
-
#api_key ⇒ String?
Sent as the
X-API-Keyheader. -
#base_url ⇒ String
The API base URL.
-
#timeout ⇒ Float
Request timeout in seconds.
-
#transport ⇒ #call?
A custom transport, see Transport.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
36 37 38 39 40 41 |
# File 'lib/html2img/configuration.rb', line 36 def initialize @api_key = ENV.fetch("HTML2IMG_API_KEY", nil) @base_url = ENV.fetch("HTML2IMG_BASE_URI", nil) || DEFAULT_BASE_URL @timeout = DEFAULT_TIMEOUT @transport = nil end |
Instance Attribute Details
#api_key ⇒ String?
Returns sent as the X-API-Key header.
25 26 27 |
# File 'lib/html2img/configuration.rb', line 25 def api_key @api_key end |
#base_url ⇒ String
Returns the API base URL.
28 29 30 |
# File 'lib/html2img/configuration.rb', line 28 def base_url @base_url end |
#timeout ⇒ Float
Returns request timeout in seconds.
31 32 33 |
# File 'lib/html2img/configuration.rb', line 31 def timeout @timeout end |
#transport ⇒ #call?
Returns a custom transport, see Transport.
34 35 36 |
# File 'lib/html2img/configuration.rb', line 34 def transport @transport end |