Class: ApacheCrunch::DerivationRuleFinder
- Inherits:
-
Object
- Object
- ApacheCrunch::DerivationRuleFinder
- Defined in:
- lib/derivation.rb
Class Method Summary collapse
- ._build_rule_map ⇒ Object
-
.find(element_name) ⇒ Object
Returns a derivation rule that derives element with the given name.
Class Method Details
._build_rule_map ⇒ Object
101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/derivation.rb', line 101 def self._build_rule_map hsh = {} @_rules.each do |rule_cls| r = rule_cls.new r.target_names.each do |target_element| hsh[target_element] = r end end hsh end |
.find(element_name) ⇒ Object
Returns a derivation rule that derives element with the given name
96 97 98 99 |
# File 'lib/derivation.rb', line 96 def self.find(element_name) @_rule_map = self._build_rule_map if @_rule_map.nil? @_rule_map[element_name] end |