Class: Atom::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/s_data/atom_extensions/entry_mixin.rb

Instance Method Summary collapse

Instance Method Details

#extended_element(element_with_namespace) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/s_data/atom_extensions/entry_mixin.rb', line 25

def extended_element(element_with_namespace)
  namespace, element = element_with_namespace.split(':')
  self.simple_extensions.keys.each do |key|
    return self.simple_extensions[key][0] if key == "{#{SData.config[:schemas][namespace]},#{element}}"
  end
  nil
end

#to_attributesObject



33
34
35
36
37
38
39
# File 'lib/s_data/atom_extensions/entry_mixin.rb', line 33

def to_attributes
  attributes = {}
  self['http://sdata.sage.com/schemes/attributes'].each_pair do |name, values|
    attributes[name] = values.first
  end
  attributes
end