mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
33 lines
567 B
Ruby
33 lines
567 B
Ruby
module ActionView #:nodoc:
|
|
class Template
|
|
class Text < String #:nodoc:
|
|
attr_accessor :mime_type
|
|
|
|
def initialize(string, mime_type = nil)
|
|
super(string.to_s)
|
|
@mime_type = Mime[mime_type] || mime_type if mime_type
|
|
@mime_type ||= Mime::TEXT
|
|
end
|
|
|
|
def identifier
|
|
'text template'
|
|
end
|
|
|
|
def inspect
|
|
'text template'
|
|
end
|
|
|
|
def render(*args)
|
|
to_s
|
|
end
|
|
|
|
def formats
|
|
[@mime_type.to_sym]
|
|
end
|
|
|
|
def partial?
|
|
false
|
|
end
|
|
end
|
|
end
|
|
end
|