class ProductionBreakpoints::MethodOverride

Extract valueable parts of the method

Public Class Methods

new(parser, start_line, end_line) click to toggle source
# File lib/ruby-production-breakpoints/method_override.rb, line 6
def initialize(parser, start_line, end_line)
  @parser = parser
  @source_lines = parser.source_lines
  @node = parser.find_definition_node(start_line, end_line)
  @start_line = start_line
  @end_line = end_line
end

Public Instance Methods

handler_src() click to toggle source
# File lib/ruby-production-breakpoints/method_override.rb, line 20
 def handler_src
  @source_lines[@start_line - 1..@end_line - 1]
end
resume_src() click to toggle source
# File lib/ruby-production-breakpoints/method_override.rb, line 24
 def resume_src
  return if @node.last_lineno - @end_line <= 1 # if smaller or equal to one that means we are at the end of the method

   @source_lines[@end_line..(@node.last_lineno - 2)]
end
unmodified_src() click to toggle source
# File lib/ruby-production-breakpoints/method_override.rb, line 14
 def unmodified_src
  return if @start_line - @node.first_lineno <= 1 # if smaller or equal to one that means we are at the beginning of the method

   @source_lines[(@node.first_lineno)..(@start_line - 2)]
end