Class: Cel::List
- Defined in:
- lib/cel/ast/elements.rb
Instance Attribute Summary
Attributes inherited from Literal
Instance Method Summary collapse
-
#initialize(value) ⇒ List
constructor
A new instance of List.
- #to_ary ⇒ Object
- #to_ruby_type ⇒ Object
Methods inherited from Literal
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_ary ⇒ Object
308 309 310 |
# File 'lib/cel/ast/elements.rb', line 308 def to_ary [self] end |
#to_ruby_type ⇒ Object
312 313 314 |
# File 'lib/cel/ast/elements.rb', line 312 def to_ruby_type value.map(&:to_ruby_type) end |