Class: Yakka::Configuration
- Inherits:
-
Object
- Object
- Yakka::Configuration
- Defined in:
- lib/yakka/configuration.rb
Instance Attribute Summary collapse
-
#rule_keys ⇒ Object
readonly
Returns the value of attribute rule_keys.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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.("~/.yakka")) puts "[Initializing] ".color(:red) + "Can not be done. You should run `yakka install` command first." exit 0 end @rules = YAML.load_file(File.("~/.yakka"))["rules"] @rule_keys = rules.map(&:first) end |
Instance Attribute Details
#rule_keys ⇒ Object (readonly)
Returns the value of attribute rule_keys.
5 6 7 |
# File 'lib/yakka/configuration.rb', line 5 def rule_keys @rule_keys end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
5 6 7 |
# File 'lib/yakka/configuration.rb', line 5 def rules @rules end |