Class: RubyCop::Ruby::Statements

Inherits:
List
  • Object
show all
Defined in:
lib/ruby_cop/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::Ruby::List

Instance Method Details

#to_block(params) ⇒ Object

def inspect

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

end



8
9
10
# File 'lib/ruby_cop/ruby/statements.rb', line 8

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

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



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

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

#to_program(src, filename) ⇒ Object



16
17
18
# File 'lib/ruby_cop/ruby/statements.rb', line 16

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