Method: Logue::Frame#initialize

Defined in:
lib/logue/frame.rb

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

Returns a new instance of Frame.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/logue/frame.rb', line 14

def initialize entry: nil, path: nil, line: nil, method: nil
  # entry if called from "caller(x)" elements, path/line/method if called from
  # "caller_location(x)" elements.
  if entry
    md = FRAME_RE.match entry
    @path   = md[1]
    @line   = md[2].to_i
    @method = md[3] || ""
  else
    @path   = path
    @line   = line
    @method = method
  end
end