lib/vra/request_parameters.rb in vmware-vra-2.6.1 vs lib/vra/request_parameters.rb in vmware-vra-2.7.0
- old
+ new
@@ -49,11 +49,11 @@
end
end
def set(key, type, value)
if key.to_s.include? "~"
- split_key = key.split("~")
+ split_key = key.to_s.split("~")
parent = nil
split_key.each_with_index do |item, index|
if index == 0
if @entries[item].nil?
@entries[item] = Vra::RequestParameter.new(item, nil, nil)
@@ -133,11 +133,10 @@
hash
end
def to_vra
hash = {}
-
if @children.count > 0
hash[@key] = {}
hash[@key]["data"] = {}
@@ -146,10 +145,10 @@
end
else
hash[@key] = format_value
end
- hash
+ hash.each_with_object({}) { |(key, value), h| h[key.to_s] = value }
end
def format_value
case @type
when "integer"