You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2013/03/14 19:19:03 UTC

[12/15] git commit: CIMI: Added Service::Base#parse method

CIMI: Added Service::Base#parse method

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


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/874bbf99
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/874bbf99
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/874bbf99

Branch: refs/heads/master
Commit: 874bbf99e2279714503d7b60a3f4823f39166e90
Parents: 61b2637
Author: Michal Fojtik <mf...@redhat.com>
Authored: Fri Mar 1 14:21:39 2013 +0100
Committer: David Lutterkort <lu...@redhat.com>
Committed: Wed Mar 13 17:28:13 2013 -0700

----------------------------------------------------------------------
 server/lib/cimi/service/base.rb |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/874bbf99/server/lib/cimi/service/base.rb
----------------------------------------------------------------------
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)