Class: FSLayer::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/fs_layer/link.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Link

Returns a new instance of Link.



5
6
7
# File 'lib/fs_layer/link.rb', line 5

def initialize file
  @file = file
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



3
4
5
# File 'lib/fs_layer/link.rb', line 3

def file
  @file
end

Instance Method Details

#to(symlink_destination) ⇒ Object



9
10
11
12
# File 'lib/fs_layer/link.rb', line 9

def to symlink_destination
  ::File.symlink(file.path, symlink_destination) unless FSLayer.fake?
  FSLayer::File.add(symlink_destination)
end