1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
10 | ruby language support (C) Novell Inc. |
11 \----------------------------------------------------------------------/
13 Author: Duncan Mac-Vicar <dmacvicar@suse.de>
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License
17 as published by the Free Software Foundation; either version
18 2 of the License, or (at your option) any later version.
23 #include <y2/Y2Namespace.h>
24 #include <y2/Y2Function.h>
25 #include <ycp/YStatement.h>
28 * YaST interface to a Ruby module
30 class YRubyNamespace : public Y2Namespace
33 string m_name; //! this namespace's name, eg. XML::Writer
34 bool m_all_methods; //! add the class name to all calls
37 * Construct an interface. The module must be already loaded
38 * @param name eg "XML::Writer"
40 YRubyNamespace (string name);
42 virtual ~YRubyNamespace ();
44 //! what namespace do we implement
45 virtual const string name () const { return m_name; }
46 //! used for error reporting
47 virtual const string filename () const;
49 //! unparse. useful only for YCP namespaces??
50 virtual string toString () const;
51 //! called when evaluating the import statement
52 // constructor is handled separately
53 virtual YCPValue evaluate (bool cse = false);
55 virtual Y2Function* createFunctionCall (const string name, constFunctionTypePtr requiredType);
57 VALUE _module_instance;