Class: InfluxDB::Rails::Backtrace::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/influxdb/rails/backtrace.rb

Constant Summary collapse

FORMAT =
%r{^((?:[a-zA-Z]:)?[^:]+):(\d+)(?::in `([^']+)')?$}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ Line

Returns a new instance of Line.



11
12
13
# File 'lib/influxdb/rails/backtrace.rb', line 11

def initialize(line)
  _, @file, @number, @method = line.match(FORMAT).to_a
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



7
8
9
# File 'lib/influxdb/rails/backtrace.rb', line 7

def file
  @file
end

#methodObject (readonly)

Returns the value of attribute method.



9
10
11
# File 'lib/influxdb/rails/backtrace.rb', line 9

def method
  @method
end

#numberObject (readonly)

Returns the value of attribute number.



8
9
10
# File 'lib/influxdb/rails/backtrace.rb', line 8

def number
  @number
end

Instance Method Details

#inspectObject



19
20
21
# File 'lib/influxdb/rails/backtrace.rb', line 19

def inspect
  "<Line: #{to_s}>"
end

#to_sObject



15
16
17
# File 'lib/influxdb/rails/backtrace.rb', line 15

def to_s
  "#{file}:#{number} in `#{method}'"
end