lib/cel/ast/elements.rb in cel-0.2.0 vs lib/cel/ast/elements.rb in cel-0.2.1
- old
+ new
@@ -174,10 +174,14 @@
else
raise BindingError, "can't convert #{val} to CEL type"
end
end
+ def to_ruby_type
+ @value
+ end
+
private
def check; end
end
@@ -294,10 +298,14 @@
end
def to_ary
[self]
end
+
+ def to_ruby_type
+ value.map(&:to_ruby_type)
+ end
end
class Map < Literal
def initialize(value)
value = value.to_h do |k, v|
@@ -314,9 +322,13 @@
)
end
def to_ary
[self]
+ end
+
+ def to_ruby_type
+ value.to_h { |*args| args.map(&:to_ruby_type) }
end
def respond_to_missing?(meth, *args)
super || (@value && @value.keys.any? { |k| k.to_s == meth.to_s })
end