Class: Yakka::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



7
8
9
10
11
12
13
14
15
# File 'lib/yakka/configuration.rb', line 7

def initialize
  if ! File.exists?(File.expand_path("~/.yakka"))
    puts "[Initializing] ".color(:red) + "Can not be done. You should run `yakka install` command first."
    exit 0
  end
  
  @rules      = YAML.load_file(File.expand_path("~/.yakka"))["rules"]
  @rule_keys  = rules.map(&:first)
end

Instance Attribute Details

#rule_keysObject (readonly)

Returns the value of attribute rule_keys.



5
6
7
# File 'lib/yakka/configuration.rb', line 5

def rule_keys
  @rule_keys
end

#rulesObject (readonly)

Returns the value of attribute rules.



5
6
7
# File 'lib/yakka/configuration.rb', line 5

def rules
  @rules
end