diff options
| author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-05-03 20:43:15 +0000 |
|---|---|---|
| committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-05-03 20:43:15 +0000 |
| commit | 65594d7e193b519dde1839475978f1952c28db14 (patch) | |
| tree | 931d7a69ea80001c8257005e4ce8fa21fe5f4416 /cpp | |
| parent | e9f373e4606727a9e7a1899edcc56abb09730153 (diff) | |
| download | qpid-python-65594d7e193b519dde1839475978f1952c28db14.tar.gz | |
QMF: add attribute read access to ConnectionSettings ruby class
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@940611 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
| -rw-r--r-- | cpp/bindings/qmf/ruby/qmf.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/cpp/bindings/qmf/ruby/qmf.rb b/cpp/bindings/qmf/ruby/qmf.rb index 402b99b800..cb41fd8891 100644 --- a/cpp/bindings/qmf/ruby/qmf.rb +++ b/cpp/bindings/qmf/ruby/qmf.rb @@ -189,15 +189,29 @@ module Qmf raise "Invalid attribute '#{key}'" unless good end + def get_attr(key) + _v = @impl.getAttr(key) + if _v.isString() + return _v.asString() + elsif _v.isUint() + return _v.asUint() + elsif _v.isBool() + return _v.asBool() + else + raise Exception("Argument error: value for attribute '#{key}' has unsupported type: #{_v.getType()}") + end + end + + def method_missing(name_in, *args) name = name_in.to_s if name[name.length - 1] == 61 attr = name[0..name.length - 2] set_attr(attr, args[0]) return + else + return get_attr(name) end - - super.method_missing(name_in, args) end end |
