Class: Upstream::PathFinder
- Inherits:
-
Object
- Object
- Upstream::PathFinder
- Defined in:
- lib/upstream.rb
Instance Attribute Summary collapse
-
#raw_path ⇒ Object
readonly
Returns the value of attribute raw_path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(arg) ⇒ PathFinder
constructor
A new instance of PathFinder.
- #parse ⇒ Object
Constructor Details
#initialize(arg) ⇒ PathFinder
Returns a new instance of PathFinder.
26 27 28 |
# File 'lib/upstream.rb', line 26 def initialize(arg) @raw_path = arg end |
Instance Attribute Details
#raw_path ⇒ Object (readonly)
Returns the value of attribute raw_path.
24 25 26 |
# File 'lib/upstream.rb', line 24 def raw_path @raw_path end |
Class Method Details
.get_path(arg) ⇒ Object
30 31 32 |
# File 'lib/upstream.rb', line 30 def self.get_path(arg) new(arg).parse end |
Instance Method Details
#parse ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/upstream.rb', line 34 def parse if raw_path == '.' `pwd`.chomp else raw_path end end |