Class: UserapiAi::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/userapi-ai.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



19
20
21
22
23
24
25
# File 'lib/userapi-ai.rb', line 19

def initialize
  @access_token = nil
  @api_version = :v2
  @uri_base = "https://api.userapi.ai"
  @request_timeout = 120
  @service = :midjourney
end

Instance Attribute Details

#access_tokenObject

Raises:



27
28
29
30
31
32
# File 'lib/userapi-ai.rb', line 27

def access_token
  return @access_token if @access_token

  error_text = "Userapi-Ai access token missing! See https://dashboard.userapi.ai/api-keys"
  raise ConfigurationError, error_text
end

#api_versionObject

Returns the value of attribute api_version.



17
18
19
# File 'lib/userapi-ai.rb', line 17

def api_version
  @api_version
end

#extra_headersObject

Returns the value of attribute extra_headers.



17
18
19
# File 'lib/userapi-ai.rb', line 17

def extra_headers
  @extra_headers
end

#request_timeoutObject

Returns the value of attribute request_timeout.



17
18
19
# File 'lib/userapi-ai.rb', line 17

def request_timeout
  @request_timeout
end

#serviceObject

Returns the value of attribute service.



17
18
19
# File 'lib/userapi-ai.rb', line 17

def service
  @service
end

#uri_baseObject

Returns the value of attribute uri_base.



17
18
19
# File 'lib/userapi-ai.rb', line 17

def uri_base
  @uri_base
end