Class: LinuxAdmin::FSTabEntry

Inherits:
LinuxAdmin show all
Defined in:
lib/linux_admin/fstab.rb

Constant Summary

Constants inherited from LinuxAdmin

VERSION

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Common

#cmd, #run, #run!

Constructor Details

#initialize(args = {}) ⇒ FSTabEntry

Returns a new instance of FSTabEntry.



17
18
19
20
21
22
23
24
# File 'lib/linux_admin/fstab.rb', line 17

def initialize(args = {})
  @device        = args[:device]
  @mount_point   = args[:mount_point]
  @fs_type       = args[:fs_type]
  @mount_options = args[:mount_options]
  @dumpable      = args[:dumpable]
  @fsck_order    = args[:fsck_order]
end

Instance Attribute Details

#deviceObject

Returns the value of attribute device.



10
11
12
# File 'lib/linux_admin/fstab.rb', line 10

def device
  @device
end

#dumpableObject

Returns the value of attribute dumpable.



14
15
16
# File 'lib/linux_admin/fstab.rb', line 14

def dumpable
  @dumpable
end

#fs_typeObject

Returns the value of attribute fs_type.



12
13
14
# File 'lib/linux_admin/fstab.rb', line 12

def fs_type
  @fs_type
end

#fsck_orderObject

Returns the value of attribute fsck_order.



15
16
17
# File 'lib/linux_admin/fstab.rb', line 15

def fsck_order
  @fsck_order
end

#mount_optionsObject

Returns the value of attribute mount_options.



13
14
15
# File 'lib/linux_admin/fstab.rb', line 13

def mount_options
  @mount_options
end

#mount_pointObject

Returns the value of attribute mount_point.



11
12
13
# File 'lib/linux_admin/fstab.rb', line 11

def mount_point
  @mount_point
end

Class Method Details

.from_line(fstab_line) ⇒ Object



26
27
28
29
30
31
32
33
34
35
# File 'lib/linux_admin/fstab.rb', line 26

def self.from_line(fstab_line)
  columns = fstab_line.chomp.split
  FSTabEntry.new :device        => columns[0],
                 :mount_point   => columns[1],
                 :fs_type       => columns[2],
                 :mount_options => columns[3],
                 :dumpable      => columns[4].to_i,
                 :fsck_order    => columns[5].to_i
  
end