Class: MagicWrite::Configuration
- Inherits:
-
Object
- Object
- MagicWrite::Configuration
- Defined in:
- lib/magicwrite.rb
Constant Summary collapse
- DEFAULT_URI_BASE =
'https://api.magicwrite.ai/rest/'.freeze
- DEFAULT_REQUEST_TIMEOUT =
120
Instance Attribute Summary collapse
- #access_token ⇒ Object
-
#extra_headers ⇒ Object
Returns the value of attribute extra_headers.
-
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
-
#uri_base ⇒ Object
Returns the value of attribute uri_base.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 30 |
# File 'lib/magicwrite.rb', line 25 def initialize @access_token = nil @uri_base = DEFAULT_URI_BASE @request_timeout = DEFAULT_REQUEST_TIMEOUT @extra_headers = nil end |
Instance Attribute Details
#access_token ⇒ Object
32 33 34 35 36 37 |
# File 'lib/magicwrite.rb', line 32 def access_token return @access_token if @access_token error_text = 'MagicWrite access token missing! See https://github.com/kykocamp/ruby-magicwrite#usage' raise ConfigurationError, error_text end |
#extra_headers ⇒ Object
Returns the value of attribute extra_headers.
20 21 22 |
# File 'lib/magicwrite.rb', line 20 def extra_headers @extra_headers end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
20 21 22 |
# File 'lib/magicwrite.rb', line 20 def request_timeout @request_timeout end |
#uri_base ⇒ Object
Returns the value of attribute uri_base.
20 21 22 |
# File 'lib/magicwrite.rb', line 20 def uri_base @uri_base end |