Module: HDLRuby::High::SingletonExtend
Overview
Module providing extension of class.
Instance Method Summary collapse
-
#eigen_extend(obj) ⇒ Object
Adds the singleton contents of +obj+ to current eigen class.
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
45 46 47 48 49 50 51 52 |
# File 'lib/HDLRuby/hruby_high.rb', line 45 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 |