Sha256: 18c97272cbe23128464463e8c93dc8b4852bbcad6c5938f0a3c757c67eb75758

Contents?: true

Size: 601 Bytes

Versions: 11

Compression:

Stored size: 601 Bytes

Contents

module ActionView #:nodoc:
  # = Action View Text Template
  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.respond_to?(:ref) ? @mime_type.ref : @mime_type.to_s]
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
actionpack-3.2.22.5 lib/action_view/template/text.rb
actionpack-3.2.22.4 lib/action_view/template/text.rb
actionpack-3.2.22.3 lib/action_view/template/text.rb
actionpack-3.2.22.2 lib/action_view/template/text.rb
actionpack-3.2.22.1 lib/action_view/template/text.rb
actionpack-3.2.22 lib/action_view/template/text.rb
actionpack-3.2.21 lib/action_view/template/text.rb
actionpack-3.2.20 lib/action_view/template/text.rb
actionpack-3.2.19 lib/action_view/template/text.rb
actionpack-3.2.18 lib/action_view/template/text.rb
actionpack-3.2.17 lib/action_view/template/text.rb