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



115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/cpee/instantiation.rb', line 115

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)
      ]
      sleep 0.42
    end rescue nil
  end
end