Class: Zikrash::CodeExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/zikrash/code_extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(backtrace_line) ⇒ CodeExtractor

Returns a new instance of CodeExtractor.



8
9
10
11
12
# File 'lib/zikrash/code_extractor.rb', line 8

def initialize(backtrace_line)
  self.file_location = "#{Rails.root}/#{backtrace_line.split(':')[0]}"
  self.line_number = backtrace_line.split(':')[1].to_i
  self
end

Instance Attribute Details

#file_locationObject

Returns the value of attribute file_location.



5
6
7
# File 'lib/zikrash/code_extractor.rb', line 5

def file_location
  @file_location
end

#line_numberObject

Returns the value of attribute line_number.



6
7
8
# File 'lib/zikrash/code_extractor.rb', line 6

def line_number
  @line_number
end

Instance Method Details

#resultObject



14
15
16
# File 'lib/zikrash/code_extractor.rb', line 14

def result
  retrieve_code_lines
end