Module: CPEE::Instantiation::Helpers

Included in:
HandleInstance, InstantiateUrl, InstantiateXML
Defined in:
lib/cpee/instantiation.rb

Overview

{{{

Instance Method Summary collapse

Instance Method Details

#handle_data(cpee, instance, data) ⇒ Object



120
121
122
123
124
125
126
127
128
129
130
# File 'lib/cpee/instantiation.rb', line 120

def handle_data(cpee,instance,data)
  if data
    srv = Riddl::Client.new(cpee, cpee + "?riddl-description")
    JSON::parse(data).each do |k,v|
      res = srv.resource("/#{instance}/properties/values/dataelements/#{k}")
      status, response = res.put [
        Riddl::Parameter::Simple.new('value',v)
      ]
    end rescue nil
  end
end