13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/bushido/data.rb', line 13
def publish(model, model_data)
data = {}
data[:key] = Bushido::Platform.key
data["data"] = model_data
data["data"]["ido_model"] = model
puts "Publishing Ido model"
puts data.to_json
puts Bushido::Platform.publish_url
response = JSON.parse(RestClient.post(Bushido::Platform.publish_url, data.to_json, :content_type => :json, :accept => :json))
if response['ido_id'].nil? or response['ido_version'].nil?
return false
end
return response
end
|