Method: CIMI::Service::Base#extract_properties!
- Defined in:
- lib/cimi/service/base.rb
#extract_properties!(data) ⇒ Object
FIXME: Kludge around the fact that we do not have proper *Create objects that deserialize properties by themselves
215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/cimi/service/base.rb', line 215 def extract_properties!(data) h = {} if data['property'] # Data came from XML h = data['property'].inject({}) do |r,v| r[v['key']] = v['content'] r end elsif data['properties'] h = data['properties'] end property ||= {} property.merge!(h) end |