Class: Intermix::Configuration
- Inherits:
-
Object
- Object
- Intermix::Configuration
- Defined in:
- lib/intermix/configuration.rb
Constant Summary collapse
- CLUSTER_TYPE =
'RedshiftCluster'- API_URL =
'https://dashboard.intermix.io/api'
Instance Attribute Summary collapse
-
#api_token ⇒ Object
readonly
Returns the value of attribute api_token.
-
#api_url ⇒ Object
readonly
Returns the value of attribute api_url.
-
#cluster_id ⇒ Object
readonly
Returns the value of attribute cluster_id.
-
#cluster_type ⇒ Object
readonly
Returns the value of attribute cluster_type.
Instance Method Summary collapse
- #base_uri ⇒ Object
-
#initialize(api_token:, cluster_id:) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(api_token:, cluster_id:) ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/intermix/configuration.rb', line 8 def initialize(api_token:, cluster_id:) raise ArgumentError, 'api_token cannot be nil.' unless api_token.present? raise ArgumentError, 'cluster_id cannot be nil.' unless cluster_id.present? @api_token = api_token @cluster_id = cluster_id @cluster_type = CLUSTER_TYPE @api_url = API_URL end |
Instance Attribute Details
#api_token ⇒ Object (readonly)
Returns the value of attribute api_token.
6 7 8 |
# File 'lib/intermix/configuration.rb', line 6 def api_token @api_token end |
#api_url ⇒ Object (readonly)
Returns the value of attribute api_url.
6 7 8 |
# File 'lib/intermix/configuration.rb', line 6 def api_url @api_url end |
#cluster_id ⇒ Object (readonly)
Returns the value of attribute cluster_id.
6 7 8 |
# File 'lib/intermix/configuration.rb', line 6 def cluster_id @cluster_id end |
#cluster_type ⇒ Object (readonly)
Returns the value of attribute cluster_type.
6 7 8 |
# File 'lib/intermix/configuration.rb', line 6 def cluster_type @cluster_type end |
Instance Method Details
#base_uri ⇒ Object
19 20 21 |
# File 'lib/intermix/configuration.rb', line 19 def base_uri @base_uri = "#{@api_url}/#{@cluster_type}/#{@cluster_id}" unless defined?(@base_uri) end |