Class: RubyCop::Ruby::While

Inherits:
Block show all
Defined in:
lib/ruby_cop/ruby/while.rb

Direct Known Subclasses

Until

Instance Attribute Summary collapse

Attributes inherited from Block

#params

Attributes inherited from List

#elements

Instance Method Summary collapse

Methods inherited from Statements

#to_block, #to_chained_block, #to_program

Methods inherited from List

#add

Methods inherited from Node

#accept

Constructor Details

#initialize(expression, statements) ⇒ While

Returns a new instance of While.



4
5
6
7
# File 'lib/ruby_cop/ruby/while.rb', line 4

def initialize(expression, statements)
  @expression = expression
  super(statements)
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



9
10
11
# File 'lib/ruby_cop/ruby/while.rb', line 9

def expression
  @expression
end