Class: Firewool::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/firewool.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



28
29
30
# File 'lib/firewool.rb', line 28

def initialize
  @filesystem_hits = 0
end

Instance Attribute Details

#filesystem_hitsObject

track how many times we read the yml



17
18
19
# File 'lib/firewool.rb', line 17

def filesystem_hits
  @filesystem_hits
end

#yaml_configObject (readonly)

Returns the value of attribute yaml_config.



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

def yaml_config
  @yaml_config
end

Instance Method Details

#load_configObject



19
20
21
22
# File 'lib/firewool.rb', line 19

def load_config
  @filesystem_hits += 1
  YAML.load_file("#{Rails.root.to_s}/config/firewool.yml")
end