From 7c889a8393dd83381bbd32d0f37aed8826eb47d3 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Mon, 21 Sep 2009 16:42:19 +0000 Subject: Fixed a Ruby convention problem (camel-case vs. underscores) Added method_missing function for Arguments for direct access to method output args. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@817314 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/bindings/qmf/ruby/qmf.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'qpid/cpp/bindings/qmf/ruby') diff --git a/qpid/cpp/bindings/qmf/ruby/qmf.rb b/qpid/cpp/bindings/qmf/ruby/qmf.rb index cba9759135..965858909a 100644 --- a/qpid/cpp/bindings/qmf/ruby/qmf.rb +++ b/qpid/cpp/bindings/qmf/ruby/qmf.rb @@ -405,11 +405,11 @@ module Qmf raise "No linkage to broker" unless @broker newer = @broker.console.get_objects(Query.new(:object_id => object_id)) raise "Expected exactly one update for this object" unless newer.size == 1 - mergeUpdate(newer[0]) + merge_update(newer[0]) end - def mergeUpdate(newObject) - @impl.merge(newObject.impl) + def merge_update(new_object) + @impl.merge(new_object.impl) end def deleted?() @@ -470,6 +470,14 @@ module Qmf @by_hash.each { |k, v| yield(k, v) } end + def method_missing(name, *args) + if @by_hash.include?(name.to_s) + return @by_hash[name.to_s] + end + + super.method_missing(name, args) + end + def by_key(key) val = @map.byKey(key) case val.getType -- cgit v1.2.1