Class: Frizz::Configuration
- Inherits:
-
Object
- Object
- Frizz::Configuration
- Defined in:
- lib/frizz/configuration.rb
Constant Summary collapse
- YAML_FILENAME =
"frizz.yml"
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
-
#current_environment ⇒ Object
Returns the value of attribute current_environment.
-
#environments ⇒ Object
Returns the value of attribute environments.
-
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
Instance Method Summary collapse
- #environment ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/frizz/configuration.rb', line 10 def initialize self.environments = {} # Attempt to load defaults from ENV self.access_key_id = ENV["AWS_ACCESS_KEY_ID"] self.secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"] self.current_environment = ENV["FRIZZ_ENV"] || "development" # Allow to be overridden in yaml if yaml_exists? load_yaml! start_yaml_listener end end |
Instance Attribute Details
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
7 8 9 |
# File 'lib/frizz/configuration.rb', line 7 def access_key_id @access_key_id end |
#current_environment ⇒ Object
Returns the value of attribute current_environment.
7 8 9 |
# File 'lib/frizz/configuration.rb', line 7 def current_environment @current_environment end |
#environments ⇒ Object
Returns the value of attribute environments.
7 8 9 |
# File 'lib/frizz/configuration.rb', line 7 def environments @environments end |
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
7 8 9 |
# File 'lib/frizz/configuration.rb', line 7 def secret_access_key @secret_access_key end |
Instance Method Details
#environment ⇒ Object
25 26 27 |
# File 'lib/frizz/configuration.rb', line 25 def environment environments[current_environment] || NullEnvironment.new end |