Sha256: bbd00be15ef859f51549a9f1681e7a553732fcf4184c4148f95056328c71f5cd

Contents?: true

Size: 578 Bytes

Versions: 6

Compression:

Stored size: 578 Bytes

Contents

module RbGCCXML
  # Represents a single <Argument> node.
  # Can be an argument for a Method, Function, or Constructor
  class Argument < Node

    # Get the Node for this argument's type
    def cpp_type
      type = NodeCache.find(attributes["type"])
      type.container = self
      type
    end

    # Get any default value for this argument
    def value
      self["default"]
    end

    # See Node#to_cpp, prints out C++ code for this argument
    def to_cpp(qualified = true)
      "#{self.cpp_type.to_cpp(qualified)} #{self.name}"
    end
    once :to_cpp

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rbgccxml-1.1.0 lib/rbgccxml/nodes/argument.rb
rbgccxml-1.0.4 lib/rbgccxml/nodes/argument.rb
rbgccxml-1.0.3 lib/rbgccxml/nodes/argument.rb
rbgccxml-1.0.2 lib/rbgccxml/nodes/argument.rb
rbgccxml-1.0.1 lib/rbgccxml/nodes/argument.rb
rbgccxml-1.0 lib/rbgccxml/nodes/argument.rb