Class: DefError

Inherits:
ErbPP show all
Defined in:
ext/numo/narray/gen/erbpp2.rb

Instance Attribute Summary

Attributes inherited from ErbPP

#children, #parent

Instance Method Summary collapse

Methods inherited from ErbPP

#add_child, #description, #find, #find_tmpl, #get, #load_erb, #method_missing, #method_missing_alias, #run, #set, #write

Constructor Details

#initialize(parent, name, sup_var, **opts, &block) ⇒ DefError

Returns a new instance of DefError.



313
314
315
316
# File 'ext/numo/narray/gen/erbpp2.rb', line 313

def initialize(parent, name, sup_var, **opts, &block)
  super(parent, error_name:name, error_var:"e"+name, super_var:sup_var,
        **opts, &block)
end

Dynamic Method Handling

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

Instance Method Details

#init_defObject



320
321
322
323
# File 'ext/numo/narray/gen/erbpp2.rb', line 320

def init_def
  "/*#{description}*/
  #{error_var} = rb_define_class_under(#{ns_var},\"#{error_name}\",#{super_var});"
end

#resultObject



317
318
319
# File 'ext/numo/narray/gen/erbpp2.rb', line 317

def result
  "static VALUE #{error_var};"
end