Class: SData::AtomExtensions::Nodes::Payload

Inherits:
Object
  • Object
show all
Includes:
Atom::Xml::Parseable
Defined in:
lib/s_data/atom_extensions/nodes/payload.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml = nil) ⇒ Payload

Returns a new instance of Payload.



13
14
15
16
17
18
# File 'lib/s_data/atom_extensions/nodes/payload.rb', line 13

def initialize(xml=nil)
  # temporary, until have time to add Linking atom extension
  @raw_xml = xml.read_inner_xml
  xml.read
  parse(xml)
end

Instance Attribute Details

#raw_xmlObject

Returns the value of attribute raw_xml.



6
7
8
# File 'lib/s_data/atom_extensions/nodes/payload.rb', line 6

def raw_xml
  @raw_xml
end

Class Method Details

.parse(xml) ⇒ Object



20
21
22
# File 'lib/s_data/atom_extensions/nodes/payload.rb', line 20

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

Instance Method Details

#to_xml(*params) ⇒ Object



24
25
26
27
28
# File 'lib/s_data/atom_extensions/nodes/payload.rb', line 24

def to_xml(*params)
  node = XML::Node.new("sdata:payload")
  node << content
  return node
end