Class: Safrano::Filter::DecimalLit

Inherits:
Leave
  • Object
show all
Defined in:
lib/odata/filter/base.rb,
lib/odata/filter/tree.rb,
lib/odata/filter/sequel.rb

Instance Attribute Summary

Attributes inherited from Leave

#parent

Attributes inherited from Node

#value

Instance Method Summary collapse

Methods inherited from Leave

#attach, #check_types

Methods inherited from Node

#==, #initialize, #success

Constructor Details

This class inherits a constructor from Safrano::Filter::Node

Instance Method Details

#accept?(tok, typ) ⇒ Boolean

def initialize(val) 1.53m –> value 1.53 Warning, this assumes that the m|M part in the input is really not optional Note: the tokenizer has already dropped the not usefull string parts cf. DECIMALRGX in token.rb super(val) end

Returns:

  • (Boolean)


407
408
409
410
411
412
413
414
# File 'lib/odata/filter/tree.rb', line 407

def accept?(tok, typ)
  case typ
  when :Delimiter, :Separator, :BinopBool, :BinopArithm
    nil
  else
    Parser::ErrorInvalidToken.new(tok, typ, self)
  end
end

#edm_typeObject



416
417
418
# File 'lib/odata/filter/tree.rb', line 416

def edm_type
  :decimal
end

#leuqes(_jh) ⇒ Object



243
244
245
# File 'lib/odata/filter/sequel.rb', line 243

def leuqes(_jh)
  success Sequel.lit(@value)
end