Class: Midjourney::Configuration
- Inherits:
-
Object
- Object
- Midjourney::Configuration
- Defined in:
- lib/midjourney.rb
Constant Summary collapse
- DEFAULT_API_VERSION =
"v2".freeze
- DEFAULT_URI_BASE =
"https://api.midjourneyapi.io/".freeze
- DEFAULT_REQUEST_TIMEOUT =
120
Instance Attribute Summary collapse
- #access_token ⇒ Object
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#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.
20 21 22 23 24 25 |
# File 'lib/midjourney.rb', line 20 def initialize @access_token = nil @api_version = DEFAULT_API_VERSION @uri_base = DEFAULT_URI_BASE @request_timeout = DEFAULT_REQUEST_TIMEOUT end |
Instance Attribute Details
#access_token ⇒ Object
27 28 29 30 31 32 |
# File 'lib/midjourney.rb', line 27 def access_token return @access_token if @access_token error_text = "Midjourney access token missing! See https://github.com/alexrudall/midjourney#usage" raise ConfigurationError, error_text end |
#api_version ⇒ Object
Returns the value of attribute api_version.
14 15 16 |
# File 'lib/midjourney.rb', line 14 def api_version @api_version end |
#extra_headers ⇒ Object
Returns the value of attribute extra_headers.
14 15 16 |
# File 'lib/midjourney.rb', line 14 def extra_headers @extra_headers end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
14 15 16 |
# File 'lib/midjourney.rb', line 14 def request_timeout @request_timeout end |
#uri_base ⇒ Object
Returns the value of attribute uri_base.
14 15 16 |
# File 'lib/midjourney.rb', line 14 def uri_base @uri_base end |