Browse files

eliminating another string subclass

  • Loading branch information...
1 parent 03e9a64 commit e1838bfcb805445b6eaf03f8f23501f560f939e8 @tenderlove tenderlove committed Jun 22, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 actionpack/lib/action_view/template/text.rb
View
10 actionpack/lib/action_view/template/text.rb
@@ -1,11 +1,11 @@
module ActionView #:nodoc:
# = Action View Text Template
class Template
- class Text < String #:nodoc:
+ class Text #:nodoc:
attr_accessor :mime_type
def initialize(string, mime_type = nil)
- super(string.to_s)
+ @string = string.to_s
@mime_type = Mime[mime_type] || mime_type if mime_type
@mime_type ||= Mime::TEXT
end
@@ -18,8 +18,12 @@ def inspect
'text template'
end
+ def to_str
+ @string
+ end
+
def render(*args)
- to_s
+ to_str
end
def formats

0 comments on commit e1838bf

Please sign in to comment.