Class: Nacha::Formatter::FormatterFactory

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

Class Method Summary collapse

Class Method Details

.get(format, records, options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/nacha/formatter.rb', line 10

def self.get(format, records, options = {})
  case format
  when :json
    JsonFormatter.new(records, options)
  when :html
    HtmlFormatter.new(records, options)
  when :markdown
    MarkdownFormatter.new(records, options)
  else
    raise ArgumentError, "Unknown format: #{format}"
  end
end