Class: AlmaApi::Configuration
- Inherits:
-
Object
- Object
- AlmaApi::Configuration
- Defined in:
- lib/alma_api/configuration.rb
Constant Summary collapse
- GATEWAYS =
{ na: "https://api-na.hosted.exlibrisgroup.com/almaws/v1", # North America eu: "https://api-eu.hosted.exlibrisgroup.com/almaws/v1", # Europe ap: "https://api-ap.hosted.exlibrisgroup.com/almaws/v1", # Asia-Pacific ca: "https://api-ca.hosted.exlibrisgroup.com/almaws/v1", # Canada cn: "https://api-cn.hosted.exlibrisgroup.cn/almaws/v1" # China }.freeze
- DEFAULT_GATEWAY =
GATEWAYS[:eu].freeze
- DEFAULT_FORMAT =
"json".freeze
- DEFAULT_LANGUAGE =
"en".freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#default_format ⇒ Object
Returns the value of attribute default_format.
-
#language ⇒ Object
Returns the value of attribute language.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(api_key: nil) {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(api_key: nil) {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/alma_api/configuration.rb', line 22 def initialize(api_key: nil) # Set defaults. Passing nil to the setters will set the default value. self.api_key = api_key self.base_url = nil self.default_format = nil self.language = nil self.timeout = nil # Yield self to allow block-style configuration. yield(self) if block_given? end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
16 17 18 |
# File 'lib/alma_api/configuration.rb', line 16 def api_key @api_key end |
#base_url ⇒ Object
Returns the value of attribute base_url.
16 17 18 |
# File 'lib/alma_api/configuration.rb', line 16 def base_url @base_url end |
#default_format ⇒ Object
Returns the value of attribute default_format.
16 17 18 |
# File 'lib/alma_api/configuration.rb', line 16 def default_format @default_format end |
#language ⇒ Object
Returns the value of attribute language.
16 17 18 |
# File 'lib/alma_api/configuration.rb', line 16 def language @language end |
#timeout ⇒ Object
Returns the value of attribute timeout.
16 17 18 |
# File 'lib/alma_api/configuration.rb', line 16 def timeout @timeout end |