Class: FEEL::AtLiteral
- Defined in:
- lib/feel/nodes.rb
Instance Method Summary collapse
Methods inherited from Node
#access_property, #contains_input_placeholder?, #qualified_names_in_context, #raise_evaluation_error
Instance Method Details
#eval(_context = {}) ⇒ Object
463 464 465 466 467 468 469 470 471 472 473 474 475 476 |
# File 'lib/feel/nodes.rb', line 463 def eval(_context = {}) value = string_literal.eval return nil if value.nil? case value when /\AP/ ActiveSupport::Duration.parse(value) when /\A\d{4}-\d{2}-\d{2}T/ DateTime.parse(value) when /\A\d{4}-\d{2}-\d{2}\z/ Date.parse(value) when /\A\d{2}:\d{2}/ Time.parse(value) end end |