Class: CutePrint::Location Private
- Extended by:
- FindsForeignCaller
- Defined in:
- lib/cute_print/location.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #line_number ⇒ Object readonly private
- #path ⇒ Object readonly private
Class Method Summary collapse
- .find ⇒ Object private
Instance Method Summary collapse
- #filename ⇒ Object private
-
#initialize(path, line_number) ⇒ Location
constructor
private
A new instance of Location.
Methods included from FindsForeignCaller
lib_path, nearest_foreign_caller
Constructor Details
#initialize(path, line_number) ⇒ Location
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Location.
18 19 20 21 |
# File 'lib/cute_print/location.rb', line 18 def initialize(path, line_number) @path = path @line_number = line_number end |
Instance Attribute Details
#line_number ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'lib/cute_print/location.rb', line 16 def line_number @line_number end |
#path ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/cute_print/location.rb', line 15 def path @path end |
Class Method Details
.find ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 12 13 |
# File 'lib/cute_print/location.rb', line 9 def self.find path, line_number = nearest_foreign_caller.split(':') line_number = line_number.to_i new(path, line_number) end |
Instance Method Details
#filename ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/cute_print/location.rb', line 23 def filename File.basename(@path) end |