Class: DeltaCloud::PlainFormatter::FormatObject::Instance

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



42
43
44
45
46
47
48
49
50
51
# File 'lib/plain_formatter.rb', line 42

def format
  sprintf("%-15s | %-15s | %-15s | %10s | %32s | %32s",
    @obj.id ? @obj.id[0,15] : '-',
    @obj.name ? @obj.name[0,15] : 'unknown',
    @obj.image.name ? @obj.image.name[0,15] : 'unknown',
    @obj.state ? @obj.state.to_s[0,10] : 'unknown',
    @obj.public_addresses.join(',')[0,32],
    @obj.private_addresses.join(',')[0,32]
  )
end