Class: GFSM::Data::Configuration
- Inherits:
-
Object
- Object
- GFSM::Data::Configuration
- Defined in:
- lib/data/configuration.rb
Instance Attribute Summary collapse
-
#change_types ⇒ Object
readonly
Returns the value of attribute change_types.
Instance Method Summary collapse
- #get_change_type_from_category(category) ⇒ Object
-
#initialize(config_path) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(config_path) ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/data/configuration.rb', line 10 def initialize(config_path) @change_types = [] configuration = YAML.load_file(config_path) configuration.each do |key, value| if key == "change_types" self.load_change_types(value) end end @change_types end |
Instance Attribute Details
#change_types ⇒ Object (readonly)
Returns the value of attribute change_types.
8 9 10 |
# File 'lib/data/configuration.rb', line 8 def change_types @change_types end |
Instance Method Details
#get_change_type_from_category(category) ⇒ Object
24 25 26 27 28 |
# File 'lib/data/configuration.rb', line 24 def get_change_type_from_category(category) @change_types.find do |change_type| category.match(change_type.matcher) end end |