Class: Rules::Rule

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

Instance Method Summary collapse

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

Returns:

  • (Boolean)


7
8
9
# File 'lib/earch/rule.rb', line 7

def match?(object)
  @rule.map{|k,v|send(k, v, object)}.all?
end