Class: ActionView::Template::HTML
- Inherits:
-
Object
- Object
- ActionView::Template::HTML
- Defined in:
- lib/action_view/template/html.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
- #format ⇒ Object
- #formats ⇒ Object
- #identifier ⇒ Object (also: #inspect)
-
#initialize(string, type = nil) ⇒ HTML
constructor
A new instance of HTML.
- #render(*args) ⇒ Object
- #to_str ⇒ Object
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
#type ⇒ Object (readonly)
:nodoc:
9 10 11 |
# File 'lib/action_view/template/html.rb', line 9 def type @type end |
Instance Method Details
#format ⇒ Object
35 36 37 |
# File 'lib/action_view/template/html.rb', line 35 def format @type end |
#formats ⇒ Object
39 |
# File 'lib/action_view/template/html.rb', line 39 def formats; Array(format); end |
#identifier ⇒ Object 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_str ⇒ Object
27 28 29 |
# File 'lib/action_view/template/html.rb', line 27 def to_str ERB::Util.h(@string) end |