Class: Samovar::Output::Row

Inherits:
Array
  • Object
show all
Defined in:
lib/samovar/output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ Row

Returns a new instance of Row.



41
42
43
44
# File 'lib/samovar/output.rb', line 41

def initialize(object)
	@object = object
	super object.to_a.collect(&:to_s)
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



46
47
48
# File 'lib/samovar/output.rb', line 46

def object
  @object
end

Instance Method Details

#align(columns) ⇒ Object



48
49
50
51
52
# File 'lib/samovar/output.rb', line 48

def align(columns)
	self.collect.with_index do |value, index|
		value.ljust(columns.widths[index])
	end.join('  ')
end