提交 e1838bfc 编写于 作者: A Aaron Patterson

eliminating another string subclass

上级 03e9a641
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册