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, type = nil) ⇒ Text

Returns a new instance of Text.



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

def initialize(string, type = nil)
  @string = string.to_s
  @type   = Types[type] || type if type
  @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



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

def formats
  [@type.respond_to?(:ref) ? @type.ref : @type.to_s]
end

#identifierObject



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

def identifier
  'text template'
end

#inspectObject



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

def inspect
  'text template'
end

#render(*args) ⇒ Object



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

def render(*args)
  to_str
end

#to_strObject



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

def to_str
  @string
end