summaryrefslogtreecommitdiff
path: root/Lib/ruby/rubyautodoc.swg
blob: 6b0472ce831b9e3a404c67c49af5bd7988d3112e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/* -----------------------------------------------------------------------------
 * rubyautodoc.swg
 *
 * This file implements autodoc typemaps for some common ruby methods.
 * ----------------------------------------------------------------------------- */

%define AUTODOC(func, str)
  %feature("autodoc", str) func;
%enddef


AUTODOC(to_i, "Convert $class to an Integer");
AUTODOC(to_f, "Convert $class to a Float");
AUTODOC(coerce, "Coerce class to a number");
AUTODOC(to_a, "Convert $class to an Array");
AUTODOC(to_s, "Convert class to a String representation");
AUTODOC(inspect, "Inspect class and its contents");

AUTODOC(at, "Return element at a certain index");
AUTODOC(__getitem__, "Element accessor/slicing");
AUTODOC(__setitem__, "Element setter/slicing");
AUTODOC(slice, "Return a slice (portion of) the $class");

AUTODOC(push, "Add an element at the end of the $class");
AUTODOC(pop, "Remove and return element at the end of the $class");
AUTODOC(shift, "Remove and return element at the beginning of the $class");
AUTODOC(unshift, "Add one or more elements at the beginning of the $class");
AUTODOC(first, "Return the first element in $class");
AUTODOC(last, "Return the last element in $class");


//
// Common Object methods
//
AUTODOC(hash, "Hashing function for class");
AUTODOC(dup, "Create a duplicate of the class and unfreeze it if needed");
AUTODOC(clone, "Create a duplicate of the class");

//
// Container methods
//
AUTODOC(empty, "Check if $class is empty");
AUTODOC(size, "Size or Length of the $class");
AUTODOC(insert, "Insert one or more new elements in the $class");

//
// Iterator methods (block)
//
AUTODOC(each, "Iterate thru each element in the $class.  A block must be provided");
AUTODOC(find, "Find an element in the class");
AUTODOC(each_key, "Iterate thru each key element in the $class.  A block must be provided");
AUTODOC(each_value, "Iterate thru each key element in the $class.  A block must be provided");
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");
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");
AUTODOC(select, "Iterate thru each element in the $class and select those that match a condition.  A block must be provided");
AUTODOC(delete_at, "Delete an element at a certain index");
AUTODOC(__delete__, "Delete a matching element");


//
// Hash methods
//
AUTODOC(keys, "Return an Array of key elements");
AUTODOC(values, "Return an Array of value elements");
AUTODOC(values_at, "Return an Array of value elements matching the conditions");


//
// Operators
//
#ifdef __cplusplus
AUTODOC(operator==, "Equality comparison operator");
AUTODOC(operator<=, "Lower or equal comparison operator");
AUTODOC(operator>=, "Higher or equal comparison operator");
AUTODOC(operator<, "Lower than comparison operator");
AUTODOC(operator>, "Higher than comparison operator");
AUTODOC(operator<<, "Left shifting or appending operator");
AUTODOC(operator>>, "Right shifting operator or extracting operator");
AUTODOC(operator+, "Add operator");
AUTODOC(operator-, "Subtraction operator");
AUTODOC(operator+(), "Positive operator");
AUTODOC(operator-(), "Negation operator");
AUTODOC(operator&, "AND operator");
AUTODOC(operator|, "OR operator");
AUTODOC(operator^, "XOR operator");
AUTODOC(operator~, "Invert operator");
#endif
AUTODOC(__eq__, "Equality comparison operator");
AUTODOC(__le__, "Lower or equal comparison operator");
AUTODOC(__ge__, "Higher or equal comparison operator");
AUTODOC(__lt__, "Lower than comparison operator");
AUTODOC(__gt__, "Higher than comparison operator");
AUTODOC(__lshift__, "Left shifting or appending operator");
AUTODOC(__rshift__, "Right shifting operator or extracting operator");
AUTODOC(__add___, "Add operator");
AUTODOC(__sub__, "Subtraction operator");
AUTODOC(__pos__, "Positive operator");
AUTODOC(__neg__, "Negation operator");
AUTODOC(__and__, "AND operator");
AUTODOC(__or__, "OR operator");
AUTODOC(__xor__, "XOR operator");
AUTODOC(__negate__, "Invert operator");
AUTODOC(__pow__, "Exponential operator");
AUTODOC(__divmod__, "Modulo of division");
AUTODOC(__cmp__, "Comparison operator.  Returns < 0 for less than, 0 for equal or > 1 for higher than.");