Class: Cel::Condition

Inherits:
Object
  • Object
show all
Defined in:
lib/cel/ast/elements.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(if_, then_, else_) ⇒ Condition

Returns a new instance of Condition.



566
567
568
569
570
# File 'lib/cel/ast/elements.rb', line 566

def initialize(if_, then_, else_)
  @if = if_
  @then = then_
  @else = else_
end

Instance Attribute Details

#elseObject (readonly)

Returns the value of attribute else.



564
565
566
# File 'lib/cel/ast/elements.rb', line 564

def else
  @else
end

#ifObject (readonly)

Returns the value of attribute if.



564
565
566
# File 'lib/cel/ast/elements.rb', line 564

def if
  @if
end

#thenObject (readonly)

Returns the value of attribute then.



564
565
566
# File 'lib/cel/ast/elements.rb', line 564

def then
  @then
end

Instance Method Details

#==(other) ⇒ Object



572
573
574
# File 'lib/cel/ast/elements.rb', line 572

def ==(other)
  other.is_a?(Condition) && @if == other.if && @then == other.then && @else == other.else
end