Class: Astray::File
Instance Attribute Summary collapse
-
#path ⇒ Object
(also: #absolute_path)
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, repository) ⇒ File
constructor
A new instance of File.
- #relative_path ⇒ Object
Methods included from PathLike
Constructor Details
#initialize(path, repository) ⇒ File
Returns a new instance of File.
9 10 11 12 |
# File 'lib/astray/file.rb', line 9 def initialize(path, repository) @path = path @repository = repository end |
Instance Attribute Details
#path ⇒ Object (readonly) Also known as: absolute_path
Returns the value of attribute path.
14 15 16 |
# File 'lib/astray/file.rb', line 14 def path @path end |
Instance Method Details
#relative_path ⇒ Object
17 18 19 |
# File 'lib/astray/file.rb', line 17 def relative_path @path.relative_path_from(@repository.path) end |