lib/soaspec/exchange_handlers/exchange_handler.rb in soaspec-0.1.12 vs lib/soaspec/exchange_handlers/exchange_handler.rb in soaspec-0.1.13
- old
+ new
@@ -86,9 +86,16 @@
define_singleton_method('__stored_val__' + name.to_s) do
value
end
end
+ # Set instance variable for each key in hash remove it from Hash
+ # @param [Hash] hash with items to remove from
+ # @param [Array] keys List of keys to remove from hash, setting each one
+ def set_remove_keys(hash, keys)
+ keys.each { |key| set_remove_key(hash, key) }
+ end
+
# Set instance variable and remove it from Hash
def set_remove_key(hash, key)
return unless hash.key? key
__send__("#{key}=", hash[key])
hash.delete key
\ No newline at end of file