Class: Rubycop::Analyzer::Ruby::For

Inherits:
Block show all
Defined in:
lib/rubycop/analyzer/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.



5
6
7
8
9
# File 'lib/rubycop/analyzer/ruby/for.rb', line 5

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

Instance Attribute Details

#rangeObject (readonly)

Returns the value of attribute range.



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

def range
  @range
end

#statementsObject (readonly)

Returns the value of attribute statements.



13
14
15
# File 'lib/rubycop/analyzer/ruby/for.rb', line 13

def statements
  @statements
end

#variableObject (readonly)

Returns the value of attribute variable.



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

def variable
  @variable
end