class WAB::Impl::In

Match any node that has a value equal to one of the values provided in the argument list after the path. This can be used with any type.

Public Class Methods

new(path, *values) click to toggle source

Creates a new instance with the provided parameters.

path

path to the value to compare

values

values to compare to

Calls superclass method
# File lib/wab/impl/exprs/in.rb, line 13
def initialize(path, *values)
  super(path)
  @values = values
end

Public Instance Methods

eval(data) click to toggle source
# File lib/wab/impl/exprs/in.rb, line 18
def eval(data)
  @values.include?(data.get(path))
end
native() click to toggle source
# File lib/wab/impl/exprs/in.rb, line 22
def native()
  ['IN', path].concat(@values)
end