Class: Rubycop::Analyzer::Ruby::IfOp

Inherits:
Operator show all
Defined in:
lib/rubycop/analyzer/ruby/operators.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#accept

Constructor Details

#initialize(condition, then_part, else_part) ⇒ IfOp

Returns a new instance of IfOp.



38
39
40
41
42
# File 'lib/rubycop/analyzer/ruby/operators.rb', line 38

def initialize(condition, then_part, else_part)
  @condition = condition
  @then_part = then_part
  @else_part = else_part
end

Instance Attribute Details

#conditionObject (readonly)

Returns the value of attribute condition.



44
45
46
# File 'lib/rubycop/analyzer/ruby/operators.rb', line 44

def condition
  @condition
end

#else_partObject (readonly)

Returns the value of attribute else_part.



46
47
48
# File 'lib/rubycop/analyzer/ruby/operators.rb', line 46

def else_part
  @else_part
end

#then_partObject (readonly)

Returns the value of attribute then_part.



45
46
47
# File 'lib/rubycop/analyzer/ruby/operators.rb', line 45

def then_part
  @then_part
end