Class: Killbill::Plugin::ActiveMerchant::Properties

Inherits:
Object
  • Object
show all
Defined in:
lib/killbill/helpers/active_merchant/properties.rb

Instance Method Summary collapse

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).expand_path
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_hashObject



21
22
23
# File 'lib/killbill/helpers/active_merchant/properties.rb', line 21

def to_hash
  @config.dup
end