aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template/text.rb
blob: f7d0df5ba0b65d320512cded7d335c3f2f3b1f30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module ActionView #:nodoc:
  class TextTemplate < String #:nodoc:
    def initialize(string, content_type = Mime[:html])
      super(string.to_s)
      @content_type = Mime[content_type] || content_type
    end

    def details
      {:formats => [@content_type.to_sym]}
    end

    def identifier
      self
    end

    def inspect
      'inline template'
    end

    def render(*args)
      self
    end

    def mime_type
      @content_type
    end

    def formats
      [mime_type]
    end

    def partial?
      false
    end
  end
end