Class: Module
- Inherits:
-
Object
- Object
- Module
- Defined in:
- lib/lizarb.rb
Instance Method Summary collapse
- #first_namespace ⇒ Object
- #last_namespace ⇒ Object
-
#source_location ⇒ Object
[“/path/to/liza.rb”, 1].
-
#source_location_path ⇒ Object
“/path/to/liza.rb”.
-
#source_location_radical ⇒ Object
“/path/to/liza”.
Instance Method Details
#first_namespace ⇒ Object
51 52 53 |
# File 'lib/lizarb.rb', line 51 def first_namespace to_s.rpartition('::')[0] end |
#last_namespace ⇒ Object
55 56 57 |
# File 'lib/lizarb.rb', line 55 def last_namespace to_s.rpartition('::')[-1] end |
#source_location ⇒ Object
- “/path/to/liza.rb”, 1
33 34 35 |
# File 'lib/lizarb.rb', line 33 def source_location Array Object.const_source_location to_s end |
#source_location_path ⇒ Object
“/path/to/liza.rb”
38 39 40 41 42 |
# File 'lib/lizarb.rb', line 38 def source_location_path source_location[0] rescue nil end |
#source_location_radical ⇒ Object
“/path/to/liza”
45 46 47 48 49 |
# File 'lib/lizarb.rb', line 45 def source_location_radical source_location_path[0..-4] rescue nil end |