Class: Patm::Pattern::Or
Instance Method Summary
collapse
Methods inherited from LogicalOp
#compile_internal
#&, build_from, #compile, #compile_internal
Constructor Details
#initialize(pats) ⇒ Or
Returns a new instance of Or.
237
238
239
|
# File 'lib/patm.rb', line 237
def initialize(pats)
super(pats, '||')
end
|
Instance Method Details
#execute(mmatch, obj) ⇒ Object
240
241
242
243
244
|
# File 'lib/patm.rb', line 240
def execute(mmatch, obj)
@pats.any? do|pat|
pat.execute(mmatch, obj)
end
end
|
#inspect ⇒ Object
248
249
250
|
# File 'lib/patm.rb', line 248
def inspect
"OR(#{@pats.map(&:inspect).join(',')})"
end
|
#rest? ⇒ Boolean
245
246
247
|
# File 'lib/patm.rb', line 245
def rest?
@pats.any?(&:rest?)
end
|