Class: Rubycop::Analyzer::Ruby::Statements

Inherits:
List
  • Object
show all
Defined in:
lib/rubycop/analyzer/ruby/statements.rb

Direct Known Subclasses

Block, Program

Instance Attribute Summary

Attributes inherited from List

#elements

Instance Method Summary collapse

Methods inherited from List

#add, #initialize

Methods inherited from Node

#accept

Constructor Details

This class inherits a constructor from Rubycop::Analyzer::Ruby::List

Instance Method Details

#to_block(params) ⇒ Object

def inspect

@elements.collect { |e| e.inspect }.join

end



9
10
11
# File 'lib/rubycop/analyzer/ruby/statements.rb', line 9

def to_block(params)
  Block.new(@elements, params)
end

#to_chained_block(blocks = nil, params = nil) ⇒ Object



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

def to_chained_block(blocks=nil, params=nil)
  ChainedBlock.new(blocks, @elements, params)
end

#to_program(src, filename) ⇒ Object



17
18
19
# File 'lib/rubycop/analyzer/ruby/statements.rb', line 17

def to_program(src, filename)
  Program.new(src, filename, @elements)
end