You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by lu...@redhat.com on 2013/03/14 01:33:39 UTC
[PATCH 07/14] CIMI: Added Service::Base#parse method
From: Michal Fojtik <mf...@redhat.com>
Make possible to call .parse on Service models from
Rabbit collections.
Signed-off-by: Michal fojtik <mf...@redhat.com>
TrackedAt: http://tracker.deltacloud.org/patch/a16895d3bb6ab3596fb77fee96d041e01c3a1747
---
server/lib/cimi/service/base.rb | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/server/lib/cimi/service/base.rb b/server/lib/cimi/service/base.rb
index 8daa183..fa845d0 100644
--- a/server/lib/cimi/service/base.rb
+++ b/server/lib/cimi/service/base.rb
@@ -50,6 +50,13 @@ module CIMI::Service
define_method(:"#{name}=") { |newval| self[name] = newval }
end
end
+
+ def parse(context)
+ req = context.request
+ model = model_class.parse(req.body, req.content_type)
+ new(context, :model => model)
+ end
+
end
def initialize(context, opts)
--
1.8.1.4