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

- (Text) initialize(string, type = nil)



7
8
9
10
11
# File 'actionview/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

- (Object) type

Returns the value of attribute type



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

def type
  @type
end

Instance Method Details

- (Object) formats



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

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

- (Object) identifier



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

def identifier
  'text template'
end

- (Object) inspect



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

def inspect
  'text template'
end

- (Object) render(*args)



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

def render(*args)
  to_str
end

- (Object) to_str



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

def to_str
  @string
end