Remove register abstraction.

The template types is a private abstraction to fill in basic blanks from Action Dispatch's
mime types. As such we can modify the data structure ourselves.
This commit is contained in:
Kasper Timm Hansen 2016-01-17 15:40:36 +01:00
parent bb295be314
commit c10bb2996a

@ -6,13 +6,7 @@ class Template
class Types
class Type
cattr_accessor :types
self.types = Set.new
def self.register(*t)
types.merge(t.map(&:to_s))
end
register :html, :text, :js, :css, :xml, :json
self.types = Set.new([ :html, :text, :js, :css, :xml, :json ])
def self.[](type)
return type if type.is_a?(self)