Class: Cel::Condition
- Inherits:
-
Object
- Object
- Cel::Condition
- Defined in:
- lib/cel/ast/elements/condition.rb
Instance Attribute Summary collapse
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
-
#else ⇒ Object
readonly
Returns the value of attribute else.
-
#if ⇒ Object
readonly
Returns the value of attribute if.
-
#then ⇒ Object
readonly
Returns the value of attribute then.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(if_, then_, else_, depth: 1) ⇒ Condition
constructor
A new instance of Condition.
- #type ⇒ Object
Constructor Details
#initialize(if_, then_, else_, depth: 1) ⇒ Condition
Returns a new instance of Condition.
7 8 9 10 11 12 |
# File 'lib/cel/ast/elements/condition.rb', line 7 def initialize(if_, then_, else_, depth: 1) @if = if_ @then = then_ @else = else_ @depth = depth end |
Instance Attribute Details
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
5 6 7 |
# File 'lib/cel/ast/elements/condition.rb', line 5 def depth @depth end |
#else ⇒ Object (readonly)
Returns the value of attribute else.
5 6 7 |
# File 'lib/cel/ast/elements/condition.rb', line 5 def else @else end |
#if ⇒ Object (readonly)
Returns the value of attribute if.
5 6 7 |
# File 'lib/cel/ast/elements/condition.rb', line 5 def if @if end |
#then ⇒ Object (readonly)
Returns the value of attribute then.
5 6 7 |
# File 'lib/cel/ast/elements/condition.rb', line 5 def then @then end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/cel/ast/elements/condition.rb', line 18 def ==(other) other.is_a?(Condition) && @if == other.if && @then == other.then && @else == other.else end |
#type ⇒ Object
14 15 16 |
# File 'lib/cel/ast/elements/condition.rb', line 14 def type TYPES[:any] end |