module HDLRuby::High::SingletonExtend

Module providing extension of class.

Public Instance Methods

eigen_extend(obj) click to toggle source

Adds the singleton contents of obj to current eigen class.

NOTE: conflicting existing singleton content will be overridden if

# File lib/HDLRuby/hruby_high.rb, line 37
def eigen_extend(obj)
    # puts "eigen_extend for #{self} class=#{self.class}"
    obj.singleton_methods.each do |name|
        next if name == :yaml_tag # Do not know why we need to skip
        # puts "name=#{name}"
        self.define_singleton_method(name, &obj.singleton_method(name))
    end
end