Class: ActiveTiger::Configuration

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

Overview

The Configuration class is responsible for determining your username/password based on your given RAILS_ENV and RAILS_ROOT. It looks for a yaml configuration file at:

#{RAILS_ROOT}/config/activetiger/#{RAILS_ENV}.yml

A sample test configuration would be:

username: demo
password: password

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
# File 'lib/activetiger/configuration.rb', line 11

def initialize
  config_path = File.join(RAILS_ROOT, "config", "activetiger", "#{RAILS_ENV}.yml")
  @config = YAML.load(File.read(config_path))
end

Instance Method Details

#passwordObject



20
21
22
# File 'lib/activetiger/configuration.rb', line 20

def password
  @config["password"]
end

#usernameObject



16
17
18
# File 'lib/activetiger/configuration.rb', line 16

def username
  @config["username"]
end