Class: SOAP::Mapping::LiteralRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/adwords4r/soap4rpatches.rb

Instance Method Summary collapse

Instance Method Details

#base2obj(value, klass) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/adwords4r/soap4rpatches.rb', line 53

def base2obj(value, klass)
  v = if value.respond_to?(:data)
        value.data
      elsif value.respond_to?(:text)
        value.text
      else
        nil
      end
  ### Patch starts here ###
  if klass.to_s == 'SOAP::SOAPBase64'
    v
  ### Patch ends here ###
  elsif value.is_a?(klass)
    v
  else
    klass.to_data(v)
  end
end