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