Class: Rules

Inherits:
Object
  • Object
show all
Defined in:
lib/earch/rule.rb

Defined Under Namespace

Classes: Rule

Instance Method Summary collapse

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

Returns:

  • (Boolean)


95
96
97
# File 'lib/earch/rule.rb', line 95

def match?(object)
  @rules.find{|rule|rule.match?(object)}
end