Class: Erlash::ArrayFormatter

Inherits:
TemplateFormatter show all
Defined in:
lib/erlash/formatters/array_formatter.rb

Instance Attribute Summary

Attributes inherited from TemplateFormatter

#formatter, #object, #opts, #output

Instance Method Summary collapse

Methods inherited from TemplateFormatter

call, format, #format_elem, #initialize, #safe_call

Constructor Details

This class inherits a constructor from Erlash::TemplateFormatter

Instance Method Details

#formatObject



3
4
5
6
# File 'lib/erlash/formatters/array_formatter.rb', line 3

def format
  elems = object.map{ |e| format_elem(e) }
  "[ #{elems.join(", ")} ]"
end