Sha256: 69ff2a496bad781f8fa76ca3254d00310d875bd3e302a84f18d2852066324460

Contents?: true

Size: 388 Bytes

Versions: 1

Compression:

Stored size: 388 Bytes

Contents

Dir[File.expand_path('../formatters/*.rb', __FILE__)].each {|file| require file }

class Nomen
  module Formatters
    class UnknownFormatterError < StandardError; end

    def self.lookup(type)
      begin
        const_get(type.to_s.split('_').map(&:capitalize).join)
      rescue NameError
        raise UnknownFormatterError, "unknown formatter '#{type}'"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nomen-0.0.2 lib/nomen/formatters.rb