Class: Cel::Bool
- Defined in:
- lib/cel/ast/elements/bool.rb
Constant Summary collapse
- TRUE_VALUE =
new(true)
- FALSE_VALUE =
new(false)
Instance Attribute Summary
Attributes inherited from Literal
Class Method Summary collapse
Instance Method Summary collapse
- #! ⇒ Object
-
#initialize(value) ⇒ Bool
constructor
A new instance of Bool.
Methods inherited from Literal
Methods included from CelMethods
Constructor Details
#initialize(value) ⇒ Bool
Returns a new instance of Bool.
5 6 7 |
# File 'lib/cel/ast/elements/bool.rb', line 5 def initialize(value) super(:bool, value) end |
Class Method Details
.cast(val) ⇒ Object
28 29 30 31 32 |
# File 'lib/cel/ast/elements/bool.rb', line 28 def self.cast(val) return val if val.is_a?(Bool) val ? TRUE_VALUE : FALSE_VALUE end |
Instance Method Details
#! ⇒ Object
21 22 23 |
# File 'lib/cel/ast/elements/bool.rb', line 21 def ! Bool.cast(super) end |