Class: DefModuleFunction

Inherits:
DefMethod show all
Defined in:
ext/cumo/narray/gen/erbpp2.rb

Instance Attribute Summary

Attributes inherited from ErbPP

#children, #parent

Instance Method Summary collapse

Methods inherited from DefMethod

#c_func, #c_iter, #c_name, #cumo_id_op, #define_method_args, #op_map, #singleton

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, #load_erb, #method_missing, #method_missing_alias, #result, #run, #set, #write

Constructor Details

#initialize(parent, erb_base, **opts, &block) ⇒ DefModuleFunction

Returns a new instance of DefModuleFunction.



271
272
273
274
# File 'ext/cumo/narray/gen/erbpp2.rb', line 271

def initialize(parent, erb_base, **opts, &block)
  super(parent, erb_base, **opts, &block)
  set singleton: true
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ErbPP

Instance Method Details

#init_defObject



276
277
278
279
# File 'ext/cumo/narray/gen/erbpp2.rb', line 276

def init_def
  return if n_arg == :nodef
  "rb_define_module_function(#{define_method_args});"
end