2009-03-20 19:13:13 -04:00
|
|
|
module ActionView #:nodoc:
|
2009-12-02 23:01:01 -05:00
|
|
|
class Template
|
|
|
|
class Text < String #:nodoc:
|
|
|
|
HTML = Mime[:html]
|
|
|
|
|
|
|
|
def initialize(string, content_type = HTML)
|
|
|
|
super(string.to_s)
|
|
|
|
@content_type = Mime[content_type] || content_type
|
|
|
|
end
|
|
|
|
|
|
|
|
def details
|
|
|
|
{:formats => [@content_type.to_sym]}
|
|
|
|
end
|
|
|
|
|
|
|
|
def identifier
|
2010-01-12 18:41:04 -05:00
|
|
|
'text template'
|
2009-12-02 23:01:01 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def inspect
|
|
|
|
'text template'
|
|
|
|
end
|
|
|
|
|
|
|
|
def render(*args)
|
|
|
|
to_s
|
|
|
|
end
|
|
|
|
|
|
|
|
def mime_type
|
|
|
|
@content_type
|
|
|
|
end
|
|
|
|
|
|
|
|
def formats
|
|
|
|
[mime_type]
|
|
|
|
end
|
|
|
|
|
|
|
|
def partial?
|
|
|
|
false
|
|
|
|
end
|
2009-09-24 13:30:13 -04:00
|
|
|
end
|
2009-03-20 19:13:13 -04:00
|
|
|
end
|
|
|
|
end
|