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.



9
10
11
12
13
# File 'lib/action_view/template/html.rb', line 9

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

Instance Attribute Details

#typeObject

:nodoc:



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

def type
  @type
end

Instance Method Details

#formatsObject



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

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

#identifierObject Also known as: inspect



15
16
17
# File 'lib/action_view/template/html.rb', line 15

def identifier
  "html template"
end

#render(*args) ⇒ Object



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

def render(*args)
  to_str
end

#to_strObject



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

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