Class: OpenXmlObject

Inherits:
SOAP::Mapping::Object
  • Object
show all
Defined in:
lib/mappum/open_xml_object.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/mappum/open_xml_object.rb', line 23

def method_missing(sym, *args, &block)
  if sym.to_s[-1..-1] == "=" then
    if sym.to_s[0..7] == "xmlattr_"
      #attribute
      name = sym.to_s[8..-2]
      __add_xmlattr_from_method(name, args[0])
    else
      #element
      __add_xmlele_from_method(sym.to_s[0..-2], args[0])
    end        
  else  
    super(sym, *args, &block)
  end
end

Instance Method Details

#id=(value) ⇒ Object



37
38
39
# File 'lib/mappum/open_xml_object.rb', line 37

def id=(value)
  __add_xmlele_from_method("id", value)        
end

#type=(value) ⇒ Object



40
41
42
# File 'lib/mappum/open_xml_object.rb', line 40

def type=(value)
  __add_xmlele_from_method("type",value)        
end