Class: Mappum::RubyXmlTransform

Inherits:
RubyTransform show all
Defined in:
lib/mappum/xml_transform.rb

Instance Attribute Summary

Attributes inherited from RubyTransform

#map_catalogue

Instance Method Summary collapse

Methods inherited from RubyTransform

#transform

Constructor Details

#initialize(*args) ⇒ RubyXmlTransform

Returns a new instance of RubyXmlTransform.



198
199
200
# File 'lib/mappum/xml_transform.rb', line 198

def initialize(*args)
  super(*args)
end

Instance Method Details

#get(object, field, parent_field = nil, options = {}) ⇒ Object



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/mappum/xml_transform.rb', line 201

def get(object, field, parent_field=nil, options={})
  begin
    super(object, field, parent_field, options)
  rescue NoMethodError
    begin
      super(object, XSD::CodeGen::GenSupport.safemethodname(field.name.to_s).to_sym, parent_field, options)
    rescue NoMethodError
      #for dynamic xml nil value == no methond
      if object.kind_of?(SOAP::Mapping::Object)
        return nil
      else
        raise
      end
    end
  end
end