Class: WAB::Impl::Lt

Inherits:
PathExpr show all
Defined in:
lib/wab/impl/exprs/lt.rb

Overview

Matches a node that has a value less than the provided value. If a integer or float is provided then both integer and floats are checked. If the value provided is a time then only time nodes are checked. Any other type results in an error.

Instance Method Summary collapse

Constructor Details

#initialize(path, value) ⇒ Lt

Creates a new instance with the provided parameters.

path

path to the value to compare

value

value to compare against



15
16
17
18
# File 'lib/wab/impl/exprs/lt.rb', line 15

def initialize(path, value)
  super(path)
  @value = value
end

Instance Method Details

#eval(data) ⇒ Object



20
21
22
# File 'lib/wab/impl/exprs/lt.rb', line 20

def eval(data)
  data.get(path) < @value
end

#nativeObject



24
25
26
# File 'lib/wab/impl/exprs/lt.rb', line 24

def native()
  ['LT', path, @value]
end