Class: ActionView::Template::HTML

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

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string, type = nil) ⇒ HTML

Returns a new instance of HTML.



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

def initialize(string, type = nil)
  @string = string.to_s
  @type   = Types[type] || type if type
  @type ||= Types[:html]
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#formatsObject



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

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

#identifierObject Also known as: inspect



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

def identifier
  "html template"
end

#render(*args) ⇒ Object



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

def render(*args)
  to_str
end

#to_strObject



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

def to_str
  ERB::Util.h(@string)
end