Class: Rules::Rule
- Inherits:
-
Object
- Object
- Rules::Rule
- Defined in:
- lib/earch/rule.rb
Instance Method Summary collapse
-
#initialize(rule) ⇒ Rule
constructor
A new instance of Rule.
- #match?(object) ⇒ Boolean
Constructor Details
#initialize(rule) ⇒ Rule
Returns a new instance of Rule.
3 4 5 |
# File 'lib/earch/rule.rb', line 3 def initialize(rule) @rule = rule end |
Instance Method Details
#match?(object) ⇒ Boolean
7 8 9 |
# File 'lib/earch/rule.rb', line 7 def match?(object) @rule.map{|k,v|send(k, v, object)}.all? end |