Class: Docker::Path
- Inherits:
-
Object
- Object
- Docker::Path
- Defined in:
- lib/docker/path.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ Path
constructor
A new instance of Path.
- #to_dpath ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(path) ⇒ Path
Returns a new instance of Path.
5 6 7 8 9 |
# File 'lib/docker/path.rb', line 5 def initialize(path) raise "Bad Path: Directory Not Found" unless Dir.exist?(path) @path = File.(path) @name = @path.sub(/\/$/, '').sub(/.+\//, '') end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/docker/path.rb', line 4 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/docker/path.rb', line 4 def path @path end |
Instance Method Details
#to_dpath ⇒ Object
15 16 17 |
# File 'lib/docker/path.rb', line 15 def to_dpath self end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/docker/path.rb', line 11 def to_s @path end |