module Origen::OrgFile::Interceptable::ClassMethods

Public Instance Methods

new(*args, &block) click to toggle source
# File lib/origen/org_file/interceptable.rb, line 9
def new(*args, &block)
  o = allocate
  i = OrgFile::Interceptor.new(o)
  o.__interceptor__ = i
  i.send(:initialize, *args, &block)
  unless o.respond_to?(:global_path_to)
    puts 'When adding the OrgFile::Interceptable module to a class, the class must define an instance method called "global_path_to", like this:'
    puts
    puts '  # Must return a string that contains a global path to access the given object,'
    puts '  # here for example if the object was a pin'
    puts '  def global_path_to'
    puts '    "dut.pins(:#{id})"'
    puts '  end'
    fail "Incomplete integration of OrgFile::Interceptable in #{o.class}"
  end
  i
end