Class: DefStruct

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

Constructor Details

This class inherits a constructor from ErbPP

Dynamic Method Handling

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

Instance Method Details

#init_defObject



330
331
332
333
334
# File 'ext/numo/narray/gen/erbpp2.rb', line 330

def init_def
  items = members.map{|s| "\"#{s}\""}.join(",")
  "/*#{description}*/
  #{class_var} = rb_struct_define(\"#{class_name}\",#{items},NULL);"
end

#method_codeObject



327
328
329
# File 'ext/numo/narray/gen/erbpp2.rb', line 327

def method_code
  "static VALUE #{class_var};"
end