Class: Logue::Frame

Inherits:
Object
  • Object
show all
Defined in:
lib/logue/locations/frame.rb

Constant Summary collapse

FRAME_RE =
Regexp.new '(.*):(\d+)(?::in \`(.*)\')?'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry: nil, path: nil, line: nil, method: nil) ⇒ Frame

Returns a new instance of Frame.



9
10
11
12
13
# File 'lib/logue/locations/frame.rb', line 9

def initialize entry: nil, path: nil, line: nil, method: nil
  @path = path
  @line = line
  @method = method
end

Instance Attribute Details

#lineObject (readonly)

Returns the value of attribute line.



7
8
9
# File 'lib/logue/locations/frame.rb', line 7

def line
  @line
end

#methodObject (readonly)

Returns the value of attribute method.



7
8
9
# File 'lib/logue/locations/frame.rb', line 7

def method
  @method
end

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/logue/locations/frame.rb', line 7

def path
  @path
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/logue/locations/frame.rb', line 15

def to_s
  [:path, :line, :method].collect { |field| "#{field}: " + send(field).to_s }.join ", "
end