Class: Astray::File

Inherits:
Object
  • Object
show all
Includes:
PathLike
Defined in:
lib/astray/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PathLike

#<=>, #hash, #inspect, #to_s

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

#pathObject (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_pathObject



17
18
19
# File 'lib/astray/file.rb', line 17

def relative_path
  @path.relative_path_from(@repository.path)
end