class Mhc::Query::Term

Term

Factor ('&' Factor)*

Public Class Methods

new(context) click to toggle source
# File lib/mhc/query.rb, line 37
def initialize(context)
  @factors = [Factor.new(context)]
  @factors << Factor.new(context) while context.eat_if(:andop)
end

Public Instance Methods

to_proc() click to toggle source
# File lib/mhc/query.rb, line 42
def to_proc
  @procs = @factors.map(&:to_proc)
  return lambda {|ev| @procs.all? {|p| p.call(ev)}}
end