Class: Cel::Protobuf::Enum
- Defined in:
- lib/cel/ast/elements/protobuf.rb
Constant Summary collapse
- MAX_ENUM_INT =
protocol buffer enum fields can accept any signed 32-bit number, values outside that range will raise an error.
(2**31)
Instance Attribute Summary
Attributes inherited from Literal
Instance Method Summary collapse
- #enum_type ⇒ Object
-
#initialize(value, enum_type = nil) ⇒ Enum
constructor
A new instance of Enum.
Methods inherited from Number
Methods inherited from Literal
Methods included from CelMethods
Constructor Details
#initialize(value, enum_type = nil) ⇒ Enum
Returns a new instance of Enum.
475 476 477 478 479 |
# File 'lib/cel/ast/elements/protobuf.rb', line 475 def initialize(value, enum_type = nil) super(:int, value) @enum_type = enum_type check_overflow(@value) end |
Instance Method Details
#enum_type ⇒ Object
481 482 483 |
# File 'lib/cel/ast/elements/protobuf.rb', line 481 def enum_type @enum_type || type end |