Class: HDLRuby::LowDB::SystemT

Inherits:
Base::SystemT
  • Object
show all
Defined in:
lib/HDLRuby/hruby_db.rb

Overview

Describes system type.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ SystemT

Creates a new system type named +name+.



31
32
33
34
35
36
37
38
# File 'lib/HDLRuby/hruby_db.rb', line 31

def initialize(name)
    # Initialize the system type structure.
    super(name)
    # Update the library of existing system types.
    # Note: no check is made so an exisiting system type with a same
    # name is overwritten.
    SystemTs[@name] = self
end

Class Method Details

.get(name) ⇒ Object

Get an existing system type by +name+.



25
26
27
28
# File 'lib/HDLRuby/hruby_db.rb', line 25

def self.get(name)
    return name if name.is_a?(SystemT)
    return SystemTs[name.to_sym]
end