Class: DeltaCloud::PlainFormatter::FormatObject::StorageVolume

Inherits:
Base
  • Object
show all
Defined in:
lib/plain_formatter.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from DeltaCloud::PlainFormatter::FormatObject::Base

Instance Method Details

#formatObject



55
56
57
58
59
60
61
62
63
# File 'lib/plain_formatter.rb', line 55

def format
  sprintf("%-10s | %15s GB | %-10s | %-10s | %-15s",
    @obj.id[0,10],
    @obj.capacity ? @obj.capacity.to_s[0,15] : 'unknown',
    @obj.device ? @obj.device[0,10] : 'unknown',
    @obj.respond_to?('state') ? @obj.state[0,10] : 'unknown',
    @obj.instance ? @obj.instance.name[0,15] : 'unknown'
  )
end