lib/mulder/formatter.rb in mulder-0.3.1 vs lib/mulder/formatter.rb in mulder-0.3.2
- old
+ new
@@ -1,13 +1,15 @@
require_relative 'formats/base'
require_relative 'formats/human'
+require_relative 'formats/json'
module Mulder
class Formatter
VALID_FORMATS = {
- 'human' => Formats::Human
+ 'human' => Formats::Human,
+ 'json' => Formats::JSON
}
def initialize(instances, format)
unless VALID_FORMATS.keys.include?(format)
raise NotImplementedError.new("Formatting as #{format} has not been implemented!")
@@ -20,6 +22,6 @@
def output
@format.new(@instances).output
end
end
-end
\ No newline at end of file
+end