Class: LinuxAdmin::FSTab
- Inherits:
-
LinuxAdmin
- Object
- LinuxAdmin
- LinuxAdmin::FSTab
- Includes:
- Singleton
- Defined in:
- lib/linux_admin/fstab.rb
Constant Summary
Constants inherited from LinuxAdmin
Instance Attribute Summary collapse
-
#entries ⇒ Object
Returns the value of attribute entries.
-
#maximum_column_lengths ⇒ Object
Returns the value of attribute maximum_column_lengths.
Instance Method Summary collapse
-
#initialize ⇒ FSTab
constructor
A new instance of FSTab.
- #write! ⇒ Object
Methods included from Common
Constructor Details
#initialize ⇒ FSTab
Returns a new instance of FSTab.
67 68 69 |
# File 'lib/linux_admin/fstab.rb', line 67 def initialize refresh end |
Instance Attribute Details
#entries ⇒ Object
Returns the value of attribute entries.
64 65 66 |
# File 'lib/linux_admin/fstab.rb', line 64 def entries @entries end |
#maximum_column_lengths ⇒ Object
Returns the value of attribute maximum_column_lengths.
65 66 67 |
# File 'lib/linux_admin/fstab.rb', line 65 def maximum_column_lengths @maximum_column_lengths end |
Instance Method Details
#write! ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/linux_admin/fstab.rb', line 71 def write! content = '' @entries.each do |entry| if entry.has_content? content << entry.formatted_columns(@maximum_column_lengths) << "\n" else content << "#{entry.comment}" end end File.write('/etc/fstab', content) self end |