Class: EC2::Platform::Linux::Mtab::Entry
- Inherits:
-
Object
- Object
- EC2::Platform::Linux::Mtab::Entry
- Defined in:
- lib/ec2/platform/linux/mtab.rb
Constant Summary collapse
- REGEX =
/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+).*$/
Instance Attribute Summary collapse
-
#device ⇒ Object
readonly
mounted device.
-
#fstype ⇒ Object
readonly
file system type.
-
#mpoint ⇒ Object
readonly
mount point.
-
#options ⇒ Object
readonly
options.
-
#value ⇒ Object
readonly
entire line.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dev, mnt_point, fs_type, opts, line) ⇒ Entry
constructor
A new instance of Entry.
- #print ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(dev, mnt_point, fs_type, opts, line) ⇒ Entry
Returns a new instance of Entry.
25 26 27 28 29 30 31 |
# File 'lib/ec2/platform/linux/mtab.rb', line 25 def initialize(dev, mnt_point, fs_type, opts, line) @device = dev @mpoint = mnt_point @fstype = fs_type = opts @value = line end |
Instance Attribute Details
#device ⇒ Object (readonly)
mounted device.
18 19 20 |
# File 'lib/ec2/platform/linux/mtab.rb', line 18 def device @device end |
#fstype ⇒ Object (readonly)
file system type.
20 21 22 |
# File 'lib/ec2/platform/linux/mtab.rb', line 20 def fstype @fstype end |
#mpoint ⇒ Object (readonly)
mount point.
19 20 21 |
# File 'lib/ec2/platform/linux/mtab.rb', line 19 def mpoint @mpoint end |
#options ⇒ Object (readonly)
options
21 22 23 |
# File 'lib/ec2/platform/linux/mtab.rb', line 21 def end |
#value ⇒ Object (readonly)
entire line
22 23 24 |
# File 'lib/ec2/platform/linux/mtab.rb', line 22 def value @value end |
Class Method Details
.parse(line) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/ec2/platform/linux/mtab.rb', line 33 def self.parse(line) return nil if line[0,1] == '#' if (m = REGEX.match(line)) parts = m.captures return Entry.new(parts[0], parts[1], parts[2], parts[3], line.strip) else return nil end end |
Instance Method Details
#print ⇒ Object
47 48 49 |
# File 'lib/ec2/platform/linux/mtab.rb', line 47 def print puts(to_s) end |
#to_s ⇒ Object
43 44 45 |
# File 'lib/ec2/platform/linux/mtab.rb', line 43 def to_s value end |