Parent

Files

Class/Module Index [+]

Quicksearch

RuboCop::ProcessedSource

ProcessedSource contains objects which are generated by Parser and other information such as disabled lines for cops. It also provides a convenient way to access source lines.

Attributes

ast[R]
buffer[R]
comment_config[R]
comments[R]
diagnostics[R]
tokens[R]

Public Class Methods

new(buffer, ast, comments, tokens, diagnostics) click to toggle source
# File lib/rubocop/processed_source.rb, line 10
def initialize(buffer, ast, comments, tokens, diagnostics)
  @buffer = buffer
  @ast = ast
  @comments = comments
  @tokens = tokens
  @diagnostics = diagnostics
  @comment_config = CommentConfig.new(self)
end

Public Instance Methods

[](*args) click to toggle source
# File lib/rubocop/processed_source.rb, line 41
def [](*args)
  lines[*args]
end
disabled_line_ranges() click to toggle source
# File lib/rubocop/processed_source.rb, line 19
def disabled_line_ranges
  comment_config.cop_disabled_line_ranges
end
file_path() click to toggle source
# File lib/rubocop/processed_source.rb, line 49
def file_path
  @buffer.name
end
lines() click to toggle source
# File lib/rubocop/processed_source.rb, line 23
def lines
  if @lines
    @lines
  else
    init_lines
    @lines
  end
end
raw_lines() click to toggle source
# File lib/rubocop/processed_source.rb, line 32
def raw_lines
  if @raw_lines
    @raw_lines
  else
    init_lines
    @raw_lines
  end
end
valid_syntax?() click to toggle source
# File lib/rubocop/processed_source.rb, line 45
def valid_syntax?
  @diagnostics.none? { |d| [:error, :fatal].include?(d.level) }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.