Class: DefFit

Inherits:
DefModule show all
Defined in:
ext/numo/gsl/fit/erbpp_fit.rb

Instance Attribute Summary

Attributes inherited from ErbPP

#children, #parent

Instance Method Summary collapse

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



9
10
11
12
13
14
15
16
17
18
# File 'ext/numo/gsl/fit/erbpp_fit.rb', line 9

def check_func(h)
  if t = lookup(h)
    if File.exist?("tmpl/#{t}.c")
      m = h[:func_name].sub(/^gsl_#{name}_/,"")
      Fit.new(self, t, name:m, **h)
      return true
    end
  end
  $stderr.puts "skip #{h[:func_name]}"
end

#lookup(h) ⇒ Object



6
7
8
# File 'ext/numo/gsl/fit/erbpp_fit.rb', line 6

def lookup(h)
  h[:func_name].sub(/^gsl_/,"")
end