Class: Frizz::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/frizz/configuration.rb

Constant Summary collapse

YAML_FILENAME =
"frizz.yml"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_idObject

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_environmentObject

Returns the value of attribute current_environment.



7
8
9
# File 'lib/frizz/configuration.rb', line 7

def current_environment
  @current_environment
end

#environmentsObject

Returns the value of attribute environments.



7
8
9
# File 'lib/frizz/configuration.rb', line 7

def environments
  @environments
end

#secret_access_keyObject

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

#environmentObject



25
26
27
# File 'lib/frizz/configuration.rb', line 25

def environment
  environments[current_environment] || NullEnvironment.new
end