Class: Toybox::Linkfile

Inherits:
Txtfile show all
Defined in:
lib/toybox/linkfile.rb

Instance Attribute Summary collapse

Attributes inherited from Txtfile

#path

Instance Method Summary collapse

Methods inherited from Txtfile

#debian_install_cmd, #install_dest, #q

Constructor Details

#initialize(p) ⇒ Linkfile

Returns a new instance of Linkfile.



4
5
6
7
# File 'lib/toybox/linkfile.rb', line 4

def initialize(p)
  super(p)
  self.link_dest = File.readlink(p)
end

Instance Attribute Details

Returns the value of attribute link_dest.



3
4
5
# File 'lib/toybox/linkfile.rb', line 3

def link_dest
  @link_dest
end

Instance Method Details

#install_cmdObject



11
12
13
# File 'lib/toybox/linkfile.rb', line 11

def install_cmd
  "@ln -s "
end

#install_srcObject



14
15
16
# File 'lib/toybox/linkfile.rb', line 14

def install_src
    link_dest
end

#to_sObject



8
9
10
# File 'lib/toybox/linkfile.rb', line 8

def to_s
  "#{self.class}: +l #{path.to_s}"
end