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.



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

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

Instance Attribute Details

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/action_view/template/text.rb', line 5

def type
  @type
end

Instance Method Details

#formatsObject



26
27
28
# File 'lib/action_view/template/text.rb', line 26

def formats
  [@type.ref]
end

#identifierObject Also known as: inspect



12
13
14
# File 'lib/action_view/template/text.rb', line 12

def identifier
  "text template"
end

#render(*args) ⇒ Object



22
23
24
# File 'lib/action_view/template/text.rb', line 22

def render(*args)
  to_str
end

#to_strObject



18
19
20
# File 'lib/action_view/template/text.rb', line 18

def to_str
  @string
end