Class: MongoProfiler::Caller
- Inherits:
-
Object
- Object
- MongoProfiler::Caller
- Defined in:
- lib/mongo_profiler/caller.rb
Instance Attribute Summary collapse
-
#_caller ⇒ Object
readonly
Returns the value of attribute _caller.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
-
#initialize(_caller) ⇒ Caller
constructor
A new instance of Caller.
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
#_caller ⇒ Object (readonly)
Returns the value of attribute _caller.
3 4 5 |
# File 'lib/mongo_profiler/caller.rb', line 3 def _caller @_caller end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
3 4 5 |
# File 'lib/mongo_profiler/caller.rb', line 3 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
3 4 5 |
# File 'lib/mongo_profiler/caller.rb', line 3 def line @line end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
3 4 5 |
# File 'lib/mongo_profiler/caller.rb', line 3 def method @method end |