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.
445 446 447 448 449 |
# File 'lib/cel/ast/elements/protobuf.rb', line 445 def initialize(value, enum_type = nil) super(:int, value) @enum_type = enum_type check_overflow(@value) end |
Instance Method Details
#enum_type ⇒ Object
451 452 453 |
# File 'lib/cel/ast/elements/protobuf.rb', line 451 def enum_type @enum_type || type end |