Class: DefGslModule
- Includes:
- ErbppGsl
- Defined in:
- ext/numo/gsl/gen/erbpp_gsl.rb
Instance Attribute Summary
Attributes inherited from ErbPP
Instance Method Summary collapse
- #check_func(h) ⇒ Object
- #define_method(t, **h) ⇒ Object
- #lookup(h) ⇒ Object
- #to_method_name(s) ⇒ Object
Methods included from ErbppGsl
FM, dbl, dblp, int, intp, long, read_const, read_enum, read_eval, read_func, read_func_pattern, read_type, str, szt, sztp, tp, uint, ulong, void
Methods inherited from DefModule
#_mod_var, #def_id, #id_list, #init_def, #init_erb, #initialize, #method_code
Methods included from DeclMethod
#def_alias, #def_alloc_func, #def_const, #def_method, #def_module_function, #def_singleton_method, #undef_alloc_func, #undef_method, #undef_singleton_method
Methods inherited from ErbPP
#add_child, #description, #find, #find_tmpl, #get, #init_def, #initialize, #load_erb, #method_missing, #method_missing_alias, #result, #run, #set, #write
Constructor Details
This class inherits a constructor from DefModule
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ErbPP
Instance Method Details
#check_func(h) ⇒ Object
136 137 138 139 140 141 142 143 |
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 136 def check_func(h) if t = lookup(h) m = to_method_name(h[:func_name]) define_method(t, name:m, **h) else $stderr.puts "skip #{h[:func_name]}" end end |
#define_method(t, **h) ⇒ Object
149 150 151 |
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 149 def define_method(t,**h) DefGslModuleFunction.new(self, t, **h) end |
#lookup(h) ⇒ Object
132 133 134 |
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 132 def lookup(h) # implement in Subclass end |
#to_method_name(s) ⇒ Object
145 146 147 |
# File 'ext/numo/gsl/gen/erbpp_gsl.rb', line 145 def to_method_name(s) s.sub(/^gsl_#{name}_/,"") end |