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.



11
12
13
14
15
16
17
18
19
# File 'lib/action_view/template/html.rb', line 11

def initialize(string, type = nil)
  unless type
    ActiveSupport::Deprecation.warn "ActionView::Template::HTML#initialize requires a type parameter"
    type = :html
  end

  @string = string.to_s
  @type   = type
end

Instance Attribute Details

#typeObject (readonly)

:nodoc:



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

def type
  @type
end

Instance Method Details

#formatObject



35
36
37
# File 'lib/action_view/template/html.rb', line 35

def format
  @type
end

#formatsObject



39
# File 'lib/action_view/template/html.rb', line 39

def formats; Array(format); end

#identifierObject Also known as: inspect



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

def identifier
  "html template"
end

#render(*args) ⇒ Object



31
32
33
# File 'lib/action_view/template/html.rb', line 31

def render(*args)
  to_str
end

#to_strObject



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

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