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