class Data
attr_accessor :param, :index, :parent, :children
def initialize()
@index = index
@param = param
@children = []
@parent = nil
end
end
It is important that "attr_accessor" keyword in above codes.
Because words following attr_accessor are recognized as member by ruby.
 


No comments:
Post a Comment