aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/template/types.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-01-17 16:12:00 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2016-01-17 17:23:58 +0100
commit85146f6de0a361b98b77c38c589e5208521571b9 (patch)
treec4ba7c5fd30288a7dbbd8fc16c954bde1eaf3edc /actionview/lib/action_view/template/types.rb
parenteb4ec6648d313586fd801582f20d845b6c2b7e20 (diff)
downloadrails-85146f6de0a361b98b77c38c589e5208521571b9.tar.gz
rails-85146f6de0a361b98b77c38c589e5208521571b9.tar.bz2
rails-85146f6de0a361b98b77c38c589e5208521571b9.zip
Enrich the SET constant to respond to symbols.
Match `Mime::SET.symbols`.
Diffstat (limited to 'actionview/lib/action_view/template/types.rb')
-rw-r--r--actionview/lib/action_view/template/types.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionview/lib/action_view/template/types.rb b/actionview/lib/action_view/template/types.rb
index 650023f6c5..f423399c30 100644
--- a/actionview/lib/action_view/template/types.rb
+++ b/actionview/lib/action_view/template/types.rb
@@ -5,7 +5,7 @@ module ActionView
class Template
class Types
class Type
- SET = Set.new([ :html, :text, :js, :css, :xml, :json ])
+ SET = Struct.new(:symbols).new(Set.new([ :html, :text, :js, :css, :xml, :json ]))
def self.[](type)
if type.is_a?(self)
@@ -47,6 +47,10 @@ module ActionView
def self.[](type)
type_klass[type]
end
+
+ def symbols
+ type_klass::SET.symbols
+ end
end
end
end