Class: AI21::Configuration
- Inherits:
-
Object
- Object
- AI21::Configuration
- Defined in:
- lib/ai21.rb
Instance Attribute Summary collapse
- #access_token ⇒ Object
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#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.
19 20 21 22 23 |
# File 'lib/ai21.rb', line 19 def initialize @access_token = nil @uri_base = "https://api.ai21.com/studio/" @api_version = "v1" end |
Instance Attribute Details
#access_token ⇒ Object
25 26 27 28 29 30 |
# File 'lib/ai21.rb', line 25 def access_token return @access_token if @access_token error_text = "AI21 access token is missing. Visit https://studio.ai21.com/account" raise ConfigurationError, error_text end |
#api_version ⇒ Object
Returns the value of attribute api_version.
17 18 19 |
# File 'lib/ai21.rb', line 17 def api_version @api_version end |
#uri_base ⇒ Object
Returns the value of attribute uri_base.
17 18 19 |
# File 'lib/ai21.rb', line 17 def uri_base @uri_base end |