lib/action_view/template/text.rb in actionpack-3.0.0.beta vs lib/action_view/template/text.rb in actionpack-3.0.0.beta2

- old
+ new

@@ -1,19 +1,16 @@ module ActionView #:nodoc: class Template class Text < String #:nodoc: - HTML = Mime[:html] + attr_accessor :mime_type - def initialize(string, content_type = HTML) + def initialize(string, mime_type = nil) super(string.to_s) - @content_type = Mime[content_type] || content_type + @mime_type = Mime[mime_type] || mime_type if mime_type + @mime_type ||= Mime::TEXT end - def details - {:formats => [@content_type.to_sym]} - end - def identifier 'text template' end def inspect @@ -22,15 +19,11 @@ def render(*args) to_s end - def mime_type - @content_type - end - def formats - [mime_type] + [@mime_type.to_sym] end def partial? false end