Class: WAB::Impl::Gte

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

Overview

Matches a node that has a value greater than or equals to 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) ⇒ Gte

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/gte.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/gte.rb', line 20

def eval(data)
  data.get(@path) >= @value
end

#nativeObject



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

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