Sha256: 65c347b97a5027a2a57487b79aa9489b98caefedadaa17b9a722dec9d23c5308
Contents?: true
Size: 498 Bytes
Versions: 8
Compression:
Stored size: 498 Bytes
Contents
require_relative 'formats/base' require_relative 'formats/human' module Mulder class Formatter VALID_FORMATS = { 'human' => Formats::Human } def initialize(instances, format) unless VALID_FORMATS.keys.include?(format) raise NotImplementedError.new("Formatting as #{format} has not been implemented!") end @instances = instances @format = VALID_FORMATS[format] end def output @format.new(@instances).output end end end
Version data entries
8 entries across 8 versions & 1 rubygems