Class: Idml::Parts::Raw

Inherits:
Object
  • Object
show all
Includes:
Idml::Part
Defined in:
lib/idml/parts/raw.rb

Overview

Fallback part class for entries the gem does not yet model typed. Wraps the raw XML verbatim — lossless round-trip, no typed access. As typed models are added under Idml::Parts::*, fewer entries will route through Raw.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Raw

Returns a new instance of Raw.



12
13
14
# File 'lib/idml/parts/raw.rb', line 12

def initialize(xml)
  @xml = xml
end

Instance Attribute Details

#xmlObject (readonly)

Returns the value of attribute xml.



16
17
18
# File 'lib/idml/parts/raw.rb', line 16

def xml
  @xml
end

Class Method Details

.from_xml(xml) ⇒ Object



18
19
20
# File 'lib/idml/parts/raw.rb', line 18

def self.from_xml(xml)
  new(xml)
end

Instance Method Details

#to_xmlObject



22
23
24
# File 'lib/idml/parts/raw.rb', line 22

def to_xml(*)
  @xml
end