Class: PDFify::Configuration
- Inherits:
-
Object
- Object
- PDFify::Configuration
- Defined in:
- lib/pdfify/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 |
# File 'lib/pdfify/configuration.rb', line 5 def initialize @api_key = nil @base_url = "https://pdfify.example.com" # Default, can be overridden @timeout = 60 # Default timeout in seconds end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/pdfify/configuration.rb', line 3 def api_key @api_key end |
#base_url ⇒ Object
Returns the value of attribute base_url.
3 4 5 |
# File 'lib/pdfify/configuration.rb', line 3 def base_url @base_url end |
#timeout ⇒ Object
Returns the value of attribute timeout.
3 4 5 |
# File 'lib/pdfify/configuration.rb', line 3 def timeout @timeout end |
Instance Method Details
#validate! ⇒ Object
11 12 13 |
# File 'lib/pdfify/configuration.rb', line 11 def validate! raise ConfigurationError, "API key is required" if api_key.nil? || api_key.empty? end |