Sha256: 9f9f0f31761e7555675d6cfabcc0400b9e65dc59c9b626db080a48dee708ea72
Contents?: true
Size: 524 Bytes
Versions: 13
Compression:
Stored size: 524 Bytes
Contents
module Cistern::Formatter::Default class << self def call(object) case object when Cistern::Collection format_collection(object) when Cistern::Model format_model(object) else object.to_s end end def format_model(model) "#{model} #{model.attributes.inspect}" end def format_collection(collection) "#{collection} #{collection.attributes.inspect} records=[#{collection.records.map { |m| format_model(m) }.join(', ')}]" end end end
Version data entries
13 entries across 13 versions & 1 rubygems