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

35 lines
558 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 :type
def initialize(string, type = nil)
@string = string.to_s
@type = Types[type] || type if type
@type ||= Types[: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
[@type.to_sym]
end
end
end
end