class Flor::Pro::Cmp
Public Instance Methods
Source
# File lib/flor/pcore/cmp.rb, line 12 def receive_last payload['ret'] = if @node['rets'].size > 1 case tree[0] when '=', '==' then check_equal when '!=', '<>' then ! check_equal when '<', '>', '>=', '<=' then check_lesser else true end else true end wrap_reply end
Protected Instance Methods
Source
# File lib/flor/pcore/cmp.rb, line 31 def check_equal @node['rets'].first == @node['rets'].last end
Source
# File lib/flor/pcore/cmp.rb, line 36 def check_lesser a, b = @node['rets'][-2], @node['rets'][-1] case tree[0] when '<' then return false if a >= b when '<=' then return false if a > b when '>' then return false if a <= b when '>=' then return false if a < b end true end