deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject [12/15] git commit: CIMI: Added Service::Base#parse method
Date Thu, 14 Mar 2013 18:19:03 GMT
CIMI: Added Service::Base#parse method

Make possible to call .parse on Service models from
Rabbit collections.

Signed-off-by: Michal fojtik <mfojtik@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 <mfojtik@redhat.com>
Authored: Fri Mar 1 14:21:39 2013 +0100
Committer: David Lutterkort <lutter@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)


Mime
View raw message