1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib/action_view/template/text.rb

35 lines
600 B
Ruby
Raw Normal View History

module ActionView #:nodoc:
2010-06-20 16:26:31 -04:00
# = Action View Text Template
class Template
2012-06-22 20:11:57 -04:00
class Text #:nodoc:
attr_accessor :mime_type
def initialize(string, mime_type = nil)
2012-06-22 20:11:57 -04:00
@string = 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
2012-06-22 20:11:57 -04:00
def to_str
@string
end
def render(*args)
2012-06-22 20:11:57 -04:00
to_str
end
def formats
[@mime_type.to_sym]
end
end
end
end