aboutsummaryrefslogblamecommitdiffstats
path: root/actionview/lib/action_view/template/html.rb
blob: 0ffae10432a1ff205727a4d05e882ddbfc24157e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                             
                       

         
                                        









                            
                                                          



         
module ActionView #:nodoc:
  # = Action View HTML Template
  class Template
    class HTML #:nodoc:
      attr_accessor :type

      def initialize(string, type = nil)
        @string = string.to_s
        @type   = Types[type] || type if type
        @type ||= Types[:html]
      end

      def identifier
        "html template"
      end

      alias_method :inspect, :identifier

      def to_str
        ERB::Util.h(@string)
      end

      def render(*args)
        to_str
      end

      def formats
        [@type.respond_to?(:ref) ? @type.ref : @type.to_s]
      end
    end
  end
end