Class: Rules
- Inherits:
-
Object
- Object
- Rules
- Defined in:
- lib/earch/rule.rb
Defined Under Namespace
Classes: Rule
Instance Method Summary collapse
-
#initialize(rules) ⇒ Rules
constructor
A new instance of Rules.
- #match?(object) ⇒ Boolean
Constructor Details
#initialize(rules) ⇒ Rules
Returns a new instance of Rules.
91 92 93 |
# File 'lib/earch/rule.rb', line 91 def initialize(rules) @rules = rules.map{|rule|Rule.new(rule)} end |
Instance Method Details
#match?(object) ⇒ Boolean
95 96 97 |
# File 'lib/earch/rule.rb', line 95 def match?(object) @rules.find{|rule|rule.match?(object)} end |