diff options
Diffstat (limited to 'cpp/rubygen/amqpgen.rb')
-rwxr-xr-x | cpp/rubygen/amqpgen.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cpp/rubygen/amqpgen.rb b/cpp/rubygen/amqpgen.rb index 6707b0c5a0..f47b8e2f9f 100755 --- a/cpp/rubygen/amqpgen.rb +++ b/cpp/rubygen/amqpgen.rb @@ -15,6 +15,9 @@ class String # Convert to underbar_separated_form. def bars() tr('- .','_'); end + # Convert to ALL_UPPERCASE_FORM + def shout() bars.upcase!; end + # Convert to lowerCaseCapitalizedForm def lcaps() gsub( /\W(\w)/ ) { |m| $1.upcase } end @@ -104,6 +107,9 @@ class AmqpElement def to_s() "#<#{self.class}(#{name})>"; end def inspect() to_s; end + + # Text of doc child if there is one. + def doc() d=xml.elements["doc"]; d and d.text; end end AmqpResponse = AmqpElement @@ -135,7 +141,7 @@ end class AmqpConstant < AmqpElement def initialize(xml, parent) super; end - amqp_attr_reader :value, :datatype + amqp_attr_reader :value, :class end class AmqpResult < AmqpElement @@ -192,7 +198,7 @@ class AmqpRoot < AmqpElement end amqp_attr_reader :major, :minor - amqp_child_reader :class, :domain + amqp_child_reader :class, :domain, :constant def version() major + "-" + minor; end |