diff options
Diffstat (limited to 'lib/soap/mapping/mapping.rb')
-rw-r--r-- | lib/soap/mapping/mapping.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/soap/mapping/mapping.rb b/lib/soap/mapping/mapping.rb index 19eca5dab0..f660c2c63f 100644 --- a/lib/soap/mapping/mapping.rb +++ b/lib/soap/mapping/mapping.rb @@ -129,6 +129,16 @@ module Mapping return registry.soap2obj(node.class, node) end + def self.set_instance_vars(obj, values) + values.each do |name, value| + setter = name + "=" + if obj.respond_to?(setter) + obj.__send__(setter, value) + else + obj.instance_eval("@#{ name } = value") + end + end + end # Allow only (Letter | '_') (Letter | Digit | '-' | '_')* here. # Caution: '.' is not allowed here. |