Class: Moon::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/moon/formatter.rb

Overview

Model formatter

Defined Under Namespace

Classes: Generic

Class Method Summary collapse

Class Method Details

.hash_for(formatters, model) ⇒ Object



7
8
9
10
11
# File 'lib/moon/formatter.rb', line 7

def self.hash_for(formatters, model)
  formatter = formatters[model.class]
  formatter ||= Moon::Formatter::Generic.new
  formatter.hash model
end