Module: HDLRuby::High::SingletonExtend

Included in:
Namespace, Scope, SystemI, SystemT
Defined in:
lib/HDLRuby/hruby_high.rb

Overview

Module providing extension of class.

Instance Method Summary collapse

Instance Method Details

#eigen_extend(obj) ⇒ Object

Adds the singleton contents of +obj+ to current eigen class.

NOTE: conflicting existing singleton content will be overridden if



37
38
39
40
41
42
43
44
# 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