Class: ActionView::Template::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/action_view/template/text.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Text

Returns a new instance of Text.



9
10
11
12
# File 'lib/action_view/template/text.rb', line 9

def initialize(string)
  @string = string.to_s
  @type = Types[:text]
end

Instance Attribute Details

#typeObject

:nodoc:



7
8
9
# File 'lib/action_view/template/text.rb', line 7

def type
  @type
end

Instance Method Details

#formatsObject



28
29
30
# File 'lib/action_view/template/text.rb', line 28

def formats
  [@type.ref]
end

#identifierObject Also known as: inspect



14
15
16
# File 'lib/action_view/template/text.rb', line 14

def identifier
  "text template"
end

#render(*args) ⇒ Object



24
25
26
# File 'lib/action_view/template/text.rb', line 24

def render(*args)
  to_str
end

#to_strObject



20
21
22
# File 'lib/action_view/template/text.rb', line 20

def to_str
  @string
end