On 14/01/11 17:06 -0800, David Lutterkort wrote:
ACK, couple comments:

On Thu, 2011-01-13 at 11:25 +0100, [email protected] wrote:
From: Michal Fojtik <[email protected]>

---
 client/lib/deltacloud.rb |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/client/lib/deltacloud.rb b/client/lib/deltacloud.rb
index 6985d5c..01cc2ca 100644
--- a/client/lib/deltacloud.rb
+++ b/client/lib/deltacloud.rb
@@ -77,6 +77,15 @@ module DeltaCloud
       yield self if block_given?
     end

+    def with_config(opts, &block)

Would be nice to document what goes into opts.

Agree, I'll put comment above.


+      api_instance = self.dup
+      api_instance.use_driver(opts[:driver],
+                             :username => opts[:username],
+                             :password => opts[:password],
+                             :provider => opts[:provider])
+      yield api_instance

Isn't that missing a 'if block_given?' ?

You're right, I'll return api_instance in case that there is no block.


  -- Michal


--
--------------------------------------------------------
Michal Fojtik, [email protected]
Deltacloud API: http://deltacloud.org
--------------------------------------------------------

Reply via email to