From 85146f6de0a361b98b77c38c589e5208521571b9 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sun, 17 Jan 2016 16:12:00 +0100 Subject: Enrich the SET constant to respond to symbols. Match `Mime::SET.symbols`. --- actionview/lib/action_view/template/types.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3