Class: Rfactor::MethodLineFinderProcessor
- Inherits:
-
SexpProcessor
- Object
- SexpProcessor
- Rfactor::MethodLineFinderProcessor
- Defined in:
- lib/rfactor/line_finder.rb
Instance Attribute Summary collapse
-
#last_method_line ⇒ Object
readonly
Returns the value of attribute last_method_line.
-
#method_line ⇒ Object
readonly
Returns the value of attribute method_line.
Instance Method Summary collapse
-
#initialize(line) ⇒ MethodLineFinderProcessor
constructor
A new instance of MethodLineFinderProcessor.
- #process_defn(exp) ⇒ Object
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_line ⇒ Object (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_line ⇒ Object (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 |