Return-Path: Delivered-To: apmail-incubator-deltacloud-dev-archive@minotaur.apache.org Received: (qmail 12283 invoked from network); 13 Nov 2010 12:32:51 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Nov 2010 12:32:51 -0000 Received: (qmail 76273 invoked by uid 500); 13 Nov 2010 12:33:22 -0000 Delivered-To: apmail-incubator-deltacloud-dev-archive@incubator.apache.org Received: (qmail 76040 invoked by uid 500); 13 Nov 2010 12:33:22 -0000 Mailing-List: contact deltacloud-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltacloud-dev@incubator.apache.org Delivered-To: mailing list deltacloud-dev@incubator.apache.org Received: (qmail 76020 invoked by uid 99); 13 Nov 2010 12:33:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Nov 2010 12:33:21 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tcrawley@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Nov 2010 12:33:15 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oADCWsq8030380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 13 Nov 2010 07:32:54 -0500 Received: from katahdin.redhat.com (vpn-9-91.rdu.redhat.com [10.11.9.91]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oADCWqU8004081 for ; Sat, 13 Nov 2010 07:32:53 -0500 From: tcrawley@redhat.com To: deltacloud-dev@incubator.apache.org Subject: [PATCH 1/2] Allow client object actions take arguments. Date: Sat, 13 Nov 2010 07:32:50 -0500 Message-Id: <1289651571-8825-2-git-send-email-tcrawley@redhat.com> In-Reply-To: <1289651571-8825-1-git-send-email-tcrawley@redhat.com> References: <1289651571-8825-1-git-send-email-tcrawley@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 From: Tobias Crawley --- client/lib/base_object.rb | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/lib/base_object.rb b/client/lib/base_object.rb index ddd1b9f..295968c 100644 --- a/client/lib/base_object.rb +++ b/client/lib/base_object.rb @@ -172,7 +172,7 @@ module DeltaCloud base_method_handler(m, args) rescue NoHandlerForMethod case m[:type] - when :action_link then do_action(m) + when :action_link then do_action(m, args) else raise NoHandlerForMethod end end @@ -180,8 +180,13 @@ module DeltaCloud private - def do_action(m) - @client.request(:"#{m[:method]}", m[:href], {}, {}) + def do_action(m, args) + args = args.first || {} + method = m[:method].to_sym + @client.request(method, + m[:href], + method == :get ? args : {}, + method == :get ? {} : args) action_trigger(m[:rel]) end -- 1.7.2.3