PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Lib/ruby/rubyautodoc.swg

#
Unknown | 105 lines | 92 code | 13 blank | 0 comment | 0 complexity | 07815c94d1c044fd21b7453ee60c039f MD5 | raw file
  1/* -----------------------------------------------------------------------------
  2 * rubyautodoc.swg
  3 *
  4 * This file implements autodoc typemaps for some common ruby methods.
  5 * ----------------------------------------------------------------------------- */
  6
  7%define AUTODOC(func, str)
  8  %feature("autodoc", str) func;
  9%enddef
 10
 11
 12AUTODOC(to_i, "Convert $class to an Integer");
 13AUTODOC(to_f, "Convert $class to a Float");
 14AUTODOC(coerce, "Coerce class to a number");
 15AUTODOC(to_a, "Convert $class to an Array");
 16AUTODOC(to_s, "Convert class to a String representation");
 17AUTODOC(inspect, "Inspect class and its contents");
 18
 19AUTODOC(at, "Return element at a certain index");
 20AUTODOC(__getitem__, "Element accessor/slicing");
 21AUTODOC(__setitem__, "Element setter/slicing");
 22AUTODOC(slice, "Return a slice (portion of) the $class");
 23
 24AUTODOC(push, "Add an element at the end of the $class");
 25AUTODOC(pop, "Remove and return element at the end of the $class");
 26AUTODOC(shift, "Remove and return element at the beginning of the $class");
 27AUTODOC(unshift, "Add one or more elements at the beginning of the $class");
 28AUTODOC(first, "Return the first element in $class");
 29AUTODOC(last, "Return the last element in $class");
 30
 31
 32//
 33// Common Object methods
 34//
 35AUTODOC(hash, "Hashing function for class");
 36AUTODOC(dup, "Create a duplicate of the class and unfreeze it if needed");
 37AUTODOC(clone, "Create a duplicate of the class");
 38
 39//
 40// Container methods
 41//
 42AUTODOC(empty, "Check if $class is empty");
 43AUTODOC(size, "Size or Length of the $class");
 44AUTODOC(insert, "Insert one or more new elements in the $class");
 45
 46//
 47// Iterator methods (block)
 48//
 49AUTODOC(each, "Iterate thru each element in the $class.  A block must be provided");
 50AUTODOC(find, "Find an element in the class");
 51AUTODOC(each_key, "Iterate thru each key element in the $class.  A block must be provided");
 52AUTODOC(each_value, "Iterate thru each key element in the $class.  A block must be provided");
 53AUTODOC(reject, "Iterate thru each element in the $class and reject those that fail a condition returning a new $class.  A block must be provided");
 54AUTODOC(reject_bang, "Iterate thru each element in the $class and reject those that fail a condition.  A block must be provided.  $class is modified in place");
 55AUTODOC(select, "Iterate thru each element in the $class and select those that match a condition.  A block must be provided");
 56AUTODOC(delete_at, "Delete an element at a certain index");
 57AUTODOC(__delete__, "Delete a matching element");
 58
 59
 60//
 61// Hash methods
 62//
 63AUTODOC(keys, "Return an Array of key elements");
 64AUTODOC(values, "Return an Array of value elements");
 65AUTODOC(values_at, "Return an Array of value elements matching the conditions");
 66
 67
 68//
 69// Operators
 70//
 71#ifdef __cplusplus
 72AUTODOC(operator==, "Equality comparison operator");
 73AUTODOC(operator<=, "Lower or equal comparison operator");
 74AUTODOC(operator>=, "Higher or equal comparison operator");
 75AUTODOC(operator<, "Lower than comparison operator");
 76AUTODOC(operator>, "Higher than comparison operator");
 77AUTODOC(operator<<, "Left shifting or appending operator");
 78AUTODOC(operator>>, "Right shifting operator or extracting operator");
 79AUTODOC(operator+, "Add operator");
 80AUTODOC(operator-, "Substraction operator");
 81AUTODOC(operator+(), "Positive operator");
 82AUTODOC(operator-(), "Negation operator");
 83AUTODOC(operator&, "AND operator");
 84AUTODOC(operator|, "OR operator");
 85AUTODOC(operator^, "XOR operator");
 86AUTODOC(operator~, "Invert operator");
 87#endif
 88AUTODOC(__eq__, "Equality comparison operator");
 89AUTODOC(__le__, "Lower or equal comparison operator");
 90AUTODOC(__ge__, "Higher or equal comparison operator");
 91AUTODOC(__lt__, "Lower than comparison operator");
 92AUTODOC(__gt__, "Higher than comparison operator");
 93AUTODOC(__lshift__, "Left shifting or appending operator");
 94AUTODOC(__rshift__, "Right shifting operator or extracting operator");
 95AUTODOC(__add___, "Add operator");
 96AUTODOC(__sub__, "Substraction operator");
 97AUTODOC(__pos__, "Positive operator");
 98AUTODOC(__neg__, "Negation operator");
 99AUTODOC(__and__, "AND operator");
100AUTODOC(__or__, "OR operator");
101AUTODOC(__xor__, "XOR operator");
102AUTODOC(__negate__, "Invert operator");
103AUTODOC(__pow__, "Exponential operator");
104AUTODOC(__divmod__, "Modulo of division");
105AUTODOC(__cmp__, "Comparison operator.  Returns < 0 for less than, 0 for equal or > 1 for higher than.");