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