Class: Killbill::Plugin::ActiveMerchant::Properties
- Defined in:
- lib/killbill/helpers/active_merchant/properties.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(file) ⇒ Properties
constructor
A new instance of Properties.
- #parse! ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(file) ⇒ Properties
Returns a new instance of Properties.
8 9 10 |
# File 'lib/killbill/helpers/active_merchant/properties.rb', line 8 def initialize(file) @config_file = Pathname.new(file). end |
Instance Method Details
#[](key) ⇒ Object
17 18 19 |
# File 'lib/killbill/helpers/active_merchant/properties.rb', line 17 def [](key) @config[key] end |
#parse! ⇒ Object
12 13 14 15 |
# File 'lib/killbill/helpers/active_merchant/properties.rb', line 12 def parse! raise "#{@config_file} is not a valid file" unless @config_file.file? @config = YAML.load(ERB.new(File.read(@config_file.to_s)).result) end |
#to_hash ⇒ Object
21 22 23 |
# File 'lib/killbill/helpers/active_merchant/properties.rb', line 21 def to_hash @config.dup end |