|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric5.Utilities.ClassBrowsers.rbclbr</title> |
|
6 <style> |
|
7 b'body {\n background:white;\n margin: 0em 1em 10em 1em;\n color: black;\n}\n\nh1 { color: white; background: #4FA4FF; }\nh2 { color: white; background: #4FA4FF; }\nh3 { color: white; background: #00557F; }\nh4 { color: white; background: #00557F; }\n \na { color: #AA5500; }\n' |
|
8 </style> |
|
9 </head> |
|
10 <body><a NAME="top" ID="top"></a> |
|
11 <h1>eric5.Utilities.ClassBrowsers.rbclbr</h1> |
|
12 <p> |
|
13 Parse a Ruby file and retrieve classes, modules, methods and attributes. |
|
14 </p><p> |
|
15 Parse enough of a Ruby file to recognize class, module and method definitions |
|
16 and to find out the superclasses of a class as well as its attributes. |
|
17 </p><p> |
|
18 It is based on the Python class browser found in this package. |
|
19 </p> |
|
20 <h3>Global Attributes</h3> |
|
21 <table> |
|
22 <tr><td>SUPPORTED_TYPES</td></tr><tr><td>_commentsub</td></tr><tr><td>_getnext</td></tr><tr><td>_modules</td></tr> |
|
23 </table> |
|
24 <h3>Classes</h3> |
|
25 <table> |
|
26 <tr> |
|
27 <td><a href="#Attribute">Attribute</a></td> |
|
28 <td>Class to represent a class or module attribute.</td> |
|
29 </tr><tr> |
|
30 <td><a href="#Class">Class</a></td> |
|
31 <td>Class to represent a Ruby class.</td> |
|
32 </tr><tr> |
|
33 <td><a href="#Function">Function</a></td> |
|
34 <td>Class to represent a Ruby function.</td> |
|
35 </tr><tr> |
|
36 <td><a href="#Module">Module</a></td> |
|
37 <td>Class to represent a Ruby module.</td> |
|
38 </tr><tr> |
|
39 <td><a href="#VisibilityMixin">VisibilityMixin</a></td> |
|
40 <td>Mixin class implementing the notion of visibility.</td> |
|
41 </tr> |
|
42 </table> |
|
43 <h3>Functions</h3> |
|
44 <table> |
|
45 <tr> |
|
46 <td><a href="#readmodule_ex">readmodule_ex</a></td> |
|
47 <td>Read a Ruby file and return a dictionary of classes, functions and modules.</td> |
|
48 </tr> |
|
49 </table> |
|
50 <hr /><hr /> |
|
51 <a NAME="Attribute" ID="Attribute"></a> |
|
52 <h2>Attribute</h2> |
|
53 <p> |
|
54 Class to represent a class or module attribute. |
|
55 </p> |
|
56 <h3>Derived from</h3> |
|
57 ClbrBaseClasses.Attribute, VisibilityMixin |
|
58 <h3>Class Attributes</h3> |
|
59 <table> |
|
60 <tr><td>None</td></tr> |
|
61 </table> |
|
62 <h3>Methods</h3> |
|
63 <table> |
|
64 <tr> |
|
65 <td><a href="#Attribute.__init__">Attribute</a></td> |
|
66 <td>Constructor</td> |
|
67 </tr> |
|
68 </table> |
|
69 <a NAME="Attribute.__init__" ID="Attribute.__init__"></a> |
|
70 <h4>Attribute (Constructor)</h4> |
|
71 <b>Attribute</b>(<i>module, name, file, lineno</i>) |
|
72 <p> |
|
73 Constructor |
|
74 </p><dl> |
|
75 <dt><i>module</i></dt> |
|
76 <dd> |
|
77 name of the module containing this class |
|
78 </dd><dt><i>name</i></dt> |
|
79 <dd> |
|
80 name of this class |
|
81 </dd><dt><i>file</i></dt> |
|
82 <dd> |
|
83 filename containing this attribute |
|
84 </dd><dt><i>lineno</i></dt> |
|
85 <dd> |
|
86 linenumber of the class definition |
|
87 </dd> |
|
88 </dl> |
|
89 <div align="right"><a href="#top">Up</a></div> |
|
90 <hr /><hr /> |
|
91 <a NAME="Class" ID="Class"></a> |
|
92 <h2>Class</h2> |
|
93 <p> |
|
94 Class to represent a Ruby class. |
|
95 </p> |
|
96 <h3>Derived from</h3> |
|
97 ClbrBaseClasses.Class, VisibilityMixin |
|
98 <h3>Class Attributes</h3> |
|
99 <table> |
|
100 <tr><td>None</td></tr> |
|
101 </table> |
|
102 <h3>Methods</h3> |
|
103 <table> |
|
104 <tr> |
|
105 <td><a href="#Class.__init__">Class</a></td> |
|
106 <td>Constructor</td> |
|
107 </tr> |
|
108 </table> |
|
109 <a NAME="Class.__init__" ID="Class.__init__"></a> |
|
110 <h4>Class (Constructor)</h4> |
|
111 <b>Class</b>(<i>module, name, super, file, lineno</i>) |
|
112 <p> |
|
113 Constructor |
|
114 </p><dl> |
|
115 <dt><i>module</i></dt> |
|
116 <dd> |
|
117 name of the module containing this class |
|
118 </dd><dt><i>name</i></dt> |
|
119 <dd> |
|
120 name of this class |
|
121 </dd><dt><i>super</i></dt> |
|
122 <dd> |
|
123 list of class names this class is inherited from |
|
124 </dd><dt><i>file</i></dt> |
|
125 <dd> |
|
126 filename containing this class |
|
127 </dd><dt><i>lineno</i></dt> |
|
128 <dd> |
|
129 linenumber of the class definition |
|
130 </dd> |
|
131 </dl> |
|
132 <div align="right"><a href="#top">Up</a></div> |
|
133 <hr /><hr /> |
|
134 <a NAME="Function" ID="Function"></a> |
|
135 <h2>Function</h2> |
|
136 <p> |
|
137 Class to represent a Ruby function. |
|
138 </p> |
|
139 <h3>Derived from</h3> |
|
140 ClbrBaseClasses.Function, VisibilityMixin |
|
141 <h3>Class Attributes</h3> |
|
142 <table> |
|
143 <tr><td>None</td></tr> |
|
144 </table> |
|
145 <h3>Methods</h3> |
|
146 <table> |
|
147 <tr> |
|
148 <td><a href="#Function.__init__">Function</a></td> |
|
149 <td>Constructor</td> |
|
150 </tr> |
|
151 </table> |
|
152 <a NAME="Function.__init__" ID="Function.__init__"></a> |
|
153 <h4>Function (Constructor)</h4> |
|
154 <b>Function</b>(<i>module, name, file, lineno, signature = '', separator = ', '</i>) |
|
155 <p> |
|
156 Constructor |
|
157 </p><dl> |
|
158 <dt><i>module</i></dt> |
|
159 <dd> |
|
160 name of the module containing this function |
|
161 </dd><dt><i>name</i></dt> |
|
162 <dd> |
|
163 name of this function |
|
164 </dd><dt><i>file</i></dt> |
|
165 <dd> |
|
166 filename containing this class |
|
167 </dd><dt><i>lineno</i></dt> |
|
168 <dd> |
|
169 linenumber of the class definition |
|
170 </dd><dt><i>signature</i></dt> |
|
171 <dd> |
|
172 parameterlist of the method |
|
173 </dd><dt><i>separator</i></dt> |
|
174 <dd> |
|
175 string separating the parameters |
|
176 </dd> |
|
177 </dl> |
|
178 <div align="right"><a href="#top">Up</a></div> |
|
179 <hr /><hr /> |
|
180 <a NAME="Module" ID="Module"></a> |
|
181 <h2>Module</h2> |
|
182 <p> |
|
183 Class to represent a Ruby module. |
|
184 </p> |
|
185 <h3>Derived from</h3> |
|
186 ClbrBaseClasses.Module, VisibilityMixin |
|
187 <h3>Class Attributes</h3> |
|
188 <table> |
|
189 <tr><td>None</td></tr> |
|
190 </table> |
|
191 <h3>Methods</h3> |
|
192 <table> |
|
193 <tr> |
|
194 <td><a href="#Module.__init__">Module</a></td> |
|
195 <td>Constructor</td> |
|
196 </tr> |
|
197 </table> |
|
198 <a NAME="Module.__init__" ID="Module.__init__"></a> |
|
199 <h4>Module (Constructor)</h4> |
|
200 <b>Module</b>(<i>module, name, file, lineno</i>) |
|
201 <p> |
|
202 Constructor |
|
203 </p><dl> |
|
204 <dt><i>module</i></dt> |
|
205 <dd> |
|
206 name of the module containing this class |
|
207 </dd><dt><i>name</i></dt> |
|
208 <dd> |
|
209 name of this class |
|
210 </dd><dt><i>file</i></dt> |
|
211 <dd> |
|
212 filename containing this class |
|
213 </dd><dt><i>lineno</i></dt> |
|
214 <dd> |
|
215 linenumber of the class definition |
|
216 </dd> |
|
217 </dl> |
|
218 <div align="right"><a href="#top">Up</a></div> |
|
219 <hr /><hr /> |
|
220 <a NAME="VisibilityMixin" ID="VisibilityMixin"></a> |
|
221 <h2>VisibilityMixin</h2> |
|
222 <p> |
|
223 Mixin class implementing the notion of visibility. |
|
224 </p> |
|
225 <h3>Derived from</h3> |
|
226 ClbrBaseClasses.ClbrVisibilityMixinBase |
|
227 <h3>Class Attributes</h3> |
|
228 <table> |
|
229 <tr><td>None</td></tr> |
|
230 </table> |
|
231 <h3>Methods</h3> |
|
232 <table> |
|
233 <tr> |
|
234 <td><a href="#VisibilityMixin.__init__">VisibilityMixin</a></td> |
|
235 <td>Method to initialize the visibility.</td> |
|
236 </tr> |
|
237 </table> |
|
238 <a NAME="VisibilityMixin.__init__" ID="VisibilityMixin.__init__"></a> |
|
239 <h4>VisibilityMixin (Constructor)</h4> |
|
240 <b>VisibilityMixin</b>(<i></i>) |
|
241 <p> |
|
242 Method to initialize the visibility. |
|
243 </p> |
|
244 <div align="right"><a href="#top">Up</a></div> |
|
245 <hr /><hr /> |
|
246 <a NAME="readmodule_ex" ID="readmodule_ex"></a> |
|
247 <h2>readmodule_ex</h2> |
|
248 <b>readmodule_ex</b>(<i>module, path=[]</i>) |
|
249 <p> |
|
250 Read a Ruby file and return a dictionary of classes, functions and modules. |
|
251 </p><dl> |
|
252 <dt><i>module</i></dt> |
|
253 <dd> |
|
254 name of the Ruby file (string) |
|
255 </dd><dt><i>path</i></dt> |
|
256 <dd> |
|
257 path the file should be searched in (list of strings) |
|
258 </dd> |
|
259 </dl><dl> |
|
260 <dt>Returns:</dt> |
|
261 <dd> |
|
262 the resulting dictionary |
|
263 </dd> |
|
264 </dl> |
|
265 <div align="right"><a href="#top">Up</a></div> |
|
266 <hr /> |
|
267 </body></html> |