Class: RTunesU::Document::Base
- Inherits:
-
Object
- Object
- RTunesU::Document::Base
- Defined in:
- lib/rtunesu/document.rb
Overview
:nodoc:
Constant Summary collapse
- INDENT =
2
Instance Attribute Summary collapse
-
#builder ⇒ Object
Returns the value of attribute builder.
-
#options ⇒ Object
Returns the value of attribute options.
-
#source ⇒ Object
Returns the value of attribute source.
-
#xml ⇒ Object
Returns the value of attribute xml.
Instance Method Summary collapse
-
#initialize(source, options = {}) ⇒ Base
constructor
Creates a new XML document using Builder.
Constructor Details
#initialize(source, options = {}) ⇒ Base
Creates a new XML document using Builder. Includes the required XML entities of ITunesUDocument and Version, then calls tag_action to add in specific XML entities for the type of document being built. tag_action is defined in each sublcass of Document.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rtunesu/document.rb', line 20 def initialize(source, = {}) self.source, self. = source, builder = Builder::XmlMarkup.new(:indent => INDENT) builder.instruct! builder.tag!('ITunesUDocument') { builder.tag!('Version', RTunesU::API_VERSION) self.xml = tag_action(builder) } self end |
Instance Attribute Details
#builder ⇒ Object
Returns the value of attribute builder.
15 16 17 |
# File 'lib/rtunesu/document.rb', line 15 def builder @builder end |
#options ⇒ Object
Returns the value of attribute options.
15 16 17 |
# File 'lib/rtunesu/document.rb', line 15 def @options end |
#source ⇒ Object
Returns the value of attribute source.
15 16 17 |
# File 'lib/rtunesu/document.rb', line 15 def source @source end |
#xml ⇒ Object
Returns the value of attribute xml.
15 16 17 |
# File 'lib/rtunesu/document.rb', line 15 def xml @xml end |