Class: Logging::CallLocation
- Inherits:
-
Object
- Object
- Logging::CallLocation
- Defined in:
- lib/logging/call_location.rb
Overview
Proxy class to allow a custom ‘caller_location` to be used
Instance Attribute Summary collapse
-
#base_label ⇒ Object
Returns the value of attribute base_label.
-
#lineno ⇒ Object
Returns the value of attribute lineno.
-
#path ⇒ Object
Returns the value of attribute path.
Class Method Summary collapse
-
.customize(call_location, function = nil, file = nil, line = nil) ⇒ Object
create proxy caller_location, default to standard values.
Instance Method Summary collapse
-
#initialize(function = nil, file = nil, line = nil) ⇒ CallLocation
constructor
create proxy caller_location.
Constructor Details
#initialize(function = nil, file = nil, line = nil) ⇒ CallLocation
create proxy caller_location
11 12 13 14 15 |
# File 'lib/logging/call_location.rb', line 11 def initialize(function = nil, file = nil, line = nil) @base_label = function @path = file @lineno = line end |
Instance Attribute Details
#base_label ⇒ Object
Returns the value of attribute base_label.
6 7 8 |
# File 'lib/logging/call_location.rb', line 6 def base_label @base_label end |
#lineno ⇒ Object
Returns the value of attribute lineno.
6 7 8 |
# File 'lib/logging/call_location.rb', line 6 def lineno @lineno end |
#path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/logging/call_location.rb', line 6 def path @path end |
Class Method Details
.customize(call_location, function = nil, file = nil, line = nil) ⇒ Object
create proxy caller_location, default to standard values
24 25 26 27 28 29 30 |
# File 'lib/logging/call_location.rb', line 24 def self.customize(call_location, function = nil, file = nil, line = nil) new( function || call_location.base_label, file || call_location.path, line || call_location.lineno ) end |