Sha256: dcb583915eff9228f770e60b50a972b8dd6a13e4d8501718a3dea298fa10dc1f

Contents?: true

Size: 567 Bytes

Versions: 3

Compression:

Stored size: 567 Bytes

Contents

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
actionpack-3.0.0.beta4 lib/action_view/template/text.rb
actionpack-3.0.0.beta3 lib/action_view/template/text.rb
actionpack-3.0.0.beta2 lib/action_view/template/text.rb