Class: Browserless::Configuration
- Inherits:
-
Object
- Object
- Browserless::Configuration
- Defined in:
- lib/browserless/configuration.rb
Constant Summary collapse
- BASE_URL =
"https://chrome.browserless.io/pdf?token="
Instance Attribute Summary collapse
- #api_key ⇒ Object
-
#emulate_media ⇒ Object
Returns the value of attribute emulate_media.
-
#options ⇒ Object
Returns the value of attribute options.
-
#style_tag ⇒ Object
Returns the value of attribute style_tag.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #url ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 |
# File 'lib/browserless/configuration.rb', line 12 def initialize @api_key = nil end |
Instance Attribute Details
#api_key ⇒ Object
16 17 18 19 20 21 |
# File 'lib/browserless/configuration.rb', line 16 def api_key return @api_key if @api_key error = "Api key missing. Check if you have defined an api key in the config/browserless.rb file." raise ConfigurationError, error end |
#emulate_media ⇒ Object
Returns the value of attribute emulate_media.
8 9 10 |
# File 'lib/browserless/configuration.rb', line 8 def emulate_media @emulate_media end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/browserless/configuration.rb', line 8 def end |
#style_tag ⇒ Object
Returns the value of attribute style_tag.
8 9 10 |
# File 'lib/browserless/configuration.rb', line 8 def style_tag @style_tag end |
Instance Method Details
#url ⇒ Object
23 24 25 |
# File 'lib/browserless/configuration.rb', line 23 def url "#{BASE_URL}#{api_key}" end |