Class: Cel::List

Inherits:
Literal
  • Object
show all
Defined in:
lib/cel/ast/elements.rb

Instance Attribute Summary

Attributes inherited from Literal

#type, #value

Instance Method Summary collapse

Methods inherited from Literal

#==, to_cel_type

Constructor Details

#initialize(value) ⇒ List

Returns a new instance of List.



301
302
303
304
305
306
# File 'lib/cel/ast/elements.rb', line 301

def initialize(value)
  value = value.map do |v|
    Literal.to_cel_type(v)
  end
  super(ListType.new(value), value)
end

Instance Method Details

#to_aryObject



308
309
310
# File 'lib/cel/ast/elements.rb', line 308

def to_ary
  [self]
end

#to_ruby_typeObject



312
313
314
# File 'lib/cel/ast/elements.rb', line 312

def to_ruby_type
  value.map(&:to_ruby_type)
end