Class: Rfactor::MethodLineFinderProcessor

Inherits:
SexpProcessor
  • Object
show all
Defined in:
lib/rfactor/line_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ MethodLineFinderProcessor

Returns a new instance of MethodLineFinderProcessor.



20
21
22
23
24
25
26
27
# File 'lib/rfactor/line_finder.rb', line 20

def initialize(line)
  super()
  self.strict = false
  self.require_empty = false
  @line = line
  @method_line = 0
  @last_method_line = 0
end

Instance Attribute Details

#last_method_lineObject (readonly)

Returns the value of attribute last_method_line.



18
19
20
# File 'lib/rfactor/line_finder.rb', line 18

def last_method_line
  @last_method_line
end

#method_lineObject (readonly)

Returns the value of attribute method_line.



17
18
19
# File 'lib/rfactor/line_finder.rb', line 17

def method_line
  @method_line
end

Instance Method Details

#process_defn(exp) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/rfactor/line_finder.rb', line 29

def process_defn(exp)
  current = exp.line
  if current > @method_line && current < @line
    @method_line = current
    @last_method_line = exp.endline
  end
  exp
end