提交 b1dcfa78 编写于 作者: K Kasper Timm Hansen

Replace class attribute with SET constant.

We'll be using this to map over to Action Dispatch's Mime::Set.
上级 c10bb299
......@@ -5,13 +5,12 @@ module ActionView
class Template
class Types
class Type
cattr_accessor :types
self.types = Set.new([ :html, :text, :js, :css, :xml, :json ])
SET = Set.new([ :html, :text, :js, :css, :xml, :json ])
def self.[](type)
return type if type.is_a?(self)
if type.is_a?(Symbol) || types.member?(type.to_s)
if type.is_a?(Symbol) || SET.member?(type.to_s)
new(type)
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册