Class: Xmonitor::Config
- Inherits:
-
Object
- Object
- Xmonitor::Config
- Defined in:
- lib/xmonitor/config.rb
Constant Summary collapse
- KEY_REGION =
'region'
- KEY_STREAM_NAME =
'stream_name'
- KEY_ACCESS_KEY_ID =
'access_key_id'
- KEY_SECRET_ACCESS_KEY =
'secret_access_key'
- KEY_ATHENA_DATABASE =
'athena_database'
- KEY_ATHENA_S3_BUCKET =
'athena_s3_bucket'
- KEY_ATHENA_TABLE_NAME =
'athena_table_name'
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
readonly
Returns the value of attribute access_key_id.
-
#athena_database ⇒ Object
readonly
Returns the value of attribute athena_database.
-
#athena_s3_bucket ⇒ Object
readonly
Returns the value of attribute athena_s3_bucket.
-
#athena_table_name ⇒ Object
readonly
Returns the value of attribute athena_table_name.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#secret_access_key ⇒ Object
readonly
Returns the value of attribute secret_access_key.
-
#stream_name ⇒ Object
readonly
Returns the value of attribute stream_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(*args) ⇒ Config
Returns a new instance of Config.
18 19 20 |
# File 'lib/xmonitor/config.rb', line 18 def initialize(*args) @region, @stream_name, @access_key_id, @secret_access_key, @athena_database, @athena_s3_bucket, @athena_table_name = *args end |
Instance Attribute Details
#access_key_id ⇒ Object (readonly)
Returns the value of attribute access_key_id.
2 3 4 |
# File 'lib/xmonitor/config.rb', line 2 def access_key_id @access_key_id end |
#athena_database ⇒ Object (readonly)
Returns the value of attribute athena_database.
2 3 4 |
# File 'lib/xmonitor/config.rb', line 2 def athena_database @athena_database end |
#athena_s3_bucket ⇒ Object (readonly)
Returns the value of attribute athena_s3_bucket.
2 3 4 |
# File 'lib/xmonitor/config.rb', line 2 def athena_s3_bucket @athena_s3_bucket end |
#athena_table_name ⇒ Object (readonly)
Returns the value of attribute athena_table_name.
2 3 4 |
# File 'lib/xmonitor/config.rb', line 2 def athena_table_name @athena_table_name end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
2 3 4 |
# File 'lib/xmonitor/config.rb', line 2 def region @region end |
#secret_access_key ⇒ Object (readonly)
Returns the value of attribute secret_access_key.
2 3 4 |
# File 'lib/xmonitor/config.rb', line 2 def secret_access_key @secret_access_key end |
#stream_name ⇒ Object (readonly)
Returns the value of attribute stream_name.
2 3 4 |
# File 'lib/xmonitor/config.rb', line 2 def stream_name @stream_name end |
Class Method Details
.from_yaml(path) ⇒ Object
12 13 14 15 16 |
# File 'lib/xmonitor/config.rb', line 12 def self.from_yaml(path) yaml = YAML.load(File.read(path)) self.new(yaml[KEY_REGION], yaml[KEY_STREAM_NAME], yaml[KEY_ACCESS_KEY_ID], yaml[KEY_SECRET_ACCESS_KEY], yaml[KEY_ATHENA_DATABASE], yaml[KEY_ATHENA_S3_BUCKET], yaml[KEY_ATHENA_TABLE_NAME]) end |