Class: TigerPayment::Configuration
- Inherits:
-
Object
- Object
- TigerPayment::Configuration
- Defined in:
- lib/tiger-payment/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/tiger-payment/#{RAILS_ENV}.yml
A sample test configuration would be:
username: demo
password: password
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #password ⇒ Object
- #username ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 |
# File 'lib/tiger-payment/configuration.rb', line 11 def initialize config_path = File.join(Rails.root, "config", "tiger-payment", "#{Rails.env}.yml") @config = YAML.load(File.read(config_path)) end |
Instance Method Details
#password ⇒ Object
20 21 22 |
# File 'lib/tiger-payment/configuration.rb', line 20 def password @config["password"] end |
#username ⇒ Object
16 17 18 |
# File 'lib/tiger-payment/configuration.rb', line 16 def username @config["username"] end |