Class: ActionView::Template::Text

Inherits:
Object
  • Object
show all
Defined in:
actionview/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
# File 'actionview/lib/action_view/template/text.rb', line 9

def initialize(string)
  @string = string.to_s
end

Instance Attribute Details

#typeObject

Returns the value of attribute type



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

def type
  @type
end

Instance Method Details

#formatObject



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

def format
  :text
end

#formatsObject



31
# File 'actionview/lib/action_view/template/text.rb', line 31

def formats; Array(format); end

#identifierObject Also known as: inspect



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

def identifier
  "text template"
end

#render(*args) ⇒ Object



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

def render(*args)
  to_str
end

#to_strObject



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

def to_str
  @string
end