Class: RubyCop::Ruby::IfOp

Inherits:
Operator show all
Defined in:
lib/ruby_cop/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.



37
38
39
40
41
# File 'lib/ruby_cop/ruby/operators.rb', line 37

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.



43
44
45
# File 'lib/ruby_cop/ruby/operators.rb', line 43

def condition
  @condition
end

#else_partObject (readonly)

Returns the value of attribute else_part.



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

def else_part
  @else_part
end

#then_partObject (readonly)

Returns the value of attribute then_part.



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

def then_part
  @then_part
end