Class: RubyCop::Ruby::For

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

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(variable, range, statements) ⇒ For

Returns a new instance of For.



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

def initialize(variable, range, statements)
  @variable = variable
  @range = range
  @statements = statements
end

Instance Attribute Details

#rangeObject (readonly)

Returns the value of attribute range.



11
12
13
# File 'lib/ruby_cop/ruby/for.rb', line 11

def range
  @range
end

#statementsObject (readonly)

Returns the value of attribute statements.



12
13
14
# File 'lib/ruby_cop/ruby/for.rb', line 12

def statements
  @statements
end

#variableObject (readonly)

Returns the value of attribute variable.



10
11
12
# File 'lib/ruby_cop/ruby/for.rb', line 10

def variable
  @variable
end