lib/shapewear/request.rb in shapewear-0.1.4 vs lib/shapewear/request.rb in shapewear-0.1.5
- old
+ new
@@ -69,12 +69,12 @@
def extract_parameters(op_options, node)
logger.debug "Operation node: #{node.inspect}"
r = []
op_options[:parameters].each do |p|
- logger.debug " Looking for: tns:#{p.first.to_s.camelize}"
- v = node.xpath("tns:#{p.first.to_s.camelize}", namespaces).first
+ logger.debug " Looking for: tns:#{p.first.camelize_if_symbol(false)}"
+ v = node.xpath("tns:#{p.first.camelize_if_symbol(false)}", namespaces).first
if v.nil?
# does nothing
elsif p.last == Fixnum
v = v.text.to_i
elsif p.last == DateTime
@@ -122,17 +122,19 @@
def extract_and_serialize_value(builder, obj, field, type)
v = if obj.is_a?(Hash)
obj[field]
elsif obj.respond_to?(field)
obj.send(field)
+ elsif obj.respond_to?(field.underscore)
+ obj.send(field.underscore)
else
raise "Could not extract #{field.inspect} from object: #{obj.inspect}"
end
if v.nil?
- builder.tag! field.to_s.camelize, 'xsi:nil' => 'true'
+ builder.tag! field.camelize_if_symbol, 'xsi:nil' => 'true'
else
- builder.tag! field.to_s.camelize, v
+ builder.tag! field.camelize_if_symbol, v
end
end
#noinspection RubyArgCount
def serialize_soap_fault(ex)