Class: SCB::API::Config
- Inherits:
-
Object
- Object
- SCB::API::Config
- Defined in:
- lib/scb/api/config.rb
Instance Attribute Summary collapse
-
#api_host ⇒ Object
Returns the value of attribute api_host.
-
#api_name ⇒ Object
Returns the value of attribute api_name.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#database ⇒ Object
Returns the value of attribute database.
-
#http_client ⇒ Object
Returns the value of attribute http_client.
-
#json_parser ⇒ Object
Returns the value of attribute json_parser.
-
#language ⇒ Object
Returns the value of attribute language.
Class Method Summary collapse
Instance Method Summary collapse
- #base_url ⇒ Object
-
#initialize {|_self| ... } ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize {|_self| ... } ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/scb/api/config.rb', line 11 def initialize @api_host = 'api.scb.se' @api_name = 'OV0104' @api_version = 'v1/doris' @language = 'sv' @database = 'ssd' @http_client = SCB::HTTP @json_parser = JSON yield self if block_given? end |
Instance Attribute Details
#api_host ⇒ Object
Returns the value of attribute api_host.
8 9 10 |
# File 'lib/scb/api/config.rb', line 8 def api_host @api_host end |
#api_name ⇒ Object
Returns the value of attribute api_name.
8 9 10 |
# File 'lib/scb/api/config.rb', line 8 def api_name @api_name end |
#api_version ⇒ Object
Returns the value of attribute api_version.
8 9 10 |
# File 'lib/scb/api/config.rb', line 8 def api_version @api_version end |
#database ⇒ Object
Returns the value of attribute database.
8 9 10 |
# File 'lib/scb/api/config.rb', line 8 def database @database end |
#http_client ⇒ Object
Returns the value of attribute http_client.
8 9 10 |
# File 'lib/scb/api/config.rb', line 8 def http_client @http_client end |
#json_parser ⇒ Object
Returns the value of attribute json_parser.
8 9 10 |
# File 'lib/scb/api/config.rb', line 8 def json_parser @json_parser end |
#language ⇒ Object
Returns the value of attribute language.
8 9 10 |
# File 'lib/scb/api/config.rb', line 8 def language @language end |
Class Method Details
.language(language) ⇒ Object
27 28 29 |
# File 'lib/scb/api/config.rb', line 27 def self.language(language) new { |c| c.language = language } end |
Instance Method Details
#base_url ⇒ Object
23 24 25 |
# File 'lib/scb/api/config.rb', line 23 def base_url "http://#{api_host}/#{api_name}/#{api_version}/#{language}/#{database}" end |