Class: Storcs::Parsers::DfNas
- Inherits:
-
Object
- Object
- Storcs::Parsers::DfNas
- Defined in:
- lib/storcs/parsers/df_nas.rb
Instance Attribute Summary collapse
-
#device ⇒ Object
Returns the value of attribute device.
Instance Method Summary collapse
-
#initialize(name, file) ⇒ DfNas
constructor
A new instance of DfNas.
- #parse!(content) ⇒ Object
Constructor Details
Instance Attribute Details
#device ⇒ Object
Returns the value of attribute device.
3 4 5 |
# File 'lib/storcs/parsers/df_nas.rb', line 3 def device @device end |
Instance Method Details
#parse!(content) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/storcs/parsers/df_nas.rb', line 10 def parse!(content) ary = content.map do |l| l.split(/\s+/) end.detect do |a| a[1] && a[1].match(/^\d+$/) end @device.real_size = ary[1].to_i * 1024 @device.real_used = ary[2].to_i * 1024 end |