Class: MongoProfiler::Caller

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo_profiler/caller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_caller) ⇒ Caller

Returns a new instance of Caller.



5
6
7
8
9
10
11
12
13
14
# File 'lib/mongo_profiler/caller.rb', line 5

def initialize(_caller)
  @_caller = _caller

  caller_head = project_callers[0].split ':'

  # i.e. "/Users/pablo/workspace/project/spec/mongo_profiler_spec.rb:7:in `new'",
  @file   = caller_head[0]
  @line   = caller_head[1].to_i
  @method = project_callers[0][/`.*'/][1..-2]
end

Instance Attribute Details

#_callerObject (readonly)

Returns the value of attribute _caller.



3
4
5
# File 'lib/mongo_profiler/caller.rb', line 3

def _caller
  @_caller
end

#fileObject (readonly)

Returns the value of attribute file.



3
4
5
# File 'lib/mongo_profiler/caller.rb', line 3

def file
  @file
end

#lineObject (readonly)

Returns the value of attribute line.



3
4
5
# File 'lib/mongo_profiler/caller.rb', line 3

def line
  @line
end

#methodObject (readonly)

Returns the value of attribute method.



3
4
5
# File 'lib/mongo_profiler/caller.rb', line 3

def method
  @method
end