Class: TVML::Document
- Inherits:
-
Object
- Object
- TVML::Document
- Defined in:
- lib/TVML/document.rb
Constant Summary collapse
- JS_ESCAPE_MAP =
{ '\\' => '\\\\', '</' => '<\/', "\r\n" => '\n', "\n" => '\n', "\r" => '\n', '"' => '\\"', "'" => "\\'" }
Instance Attribute Summary collapse
-
#builder ⇒ Object
Returns the value of attribute builder.
-
#template ⇒ Object
Returns the value of attribute template.
Instance Method Summary collapse
- #build ⇒ Object
- #build_escaped ⇒ Object
-
#initialize ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize ⇒ Document
Returns a new instance of Document.
8 9 10 11 |
# File 'lib/TVML/document.rb', line 8 def initialize @builder = Builder::XmlMarkup.new @builder.instruct! end |
Instance Attribute Details
#builder ⇒ Object
Returns the value of attribute builder.
3 4 5 |
# File 'lib/TVML/document.rb', line 3 def builder @builder end |
#template ⇒ Object
Returns the value of attribute template.
3 4 5 |
# File 'lib/TVML/document.rb', line 3 def template @template end |
Instance Method Details
#build ⇒ Object
13 14 15 16 17 |
# File 'lib/TVML/document.rb', line 13 def build @builder.document do |doc| doc << @template.build if @template end end |
#build_escaped ⇒ Object
19 20 21 |
# File 'lib/TVML/document.rb', line 19 def build_escaped escape_javascript(build) end |