module HDLRuby::Low::Ltype
Module bringing low-level properties to types
Constants
- Types
Library of the existing types.
Public Class Methods
get(name)
click to toggle source
Get an existing signal type by name
.
# File lib/HDLRuby/hruby_db.rb, line 69 def self.get(name) # return name if name.is_a?(Type) return name if name.respond_to?(:ltype?) return Types[name.to_sym] end
included(base)
click to toggle source
Ensures initialize registers the type name and adds the get methods to the class
# File lib/HDLRuby/hruby_db.rb, line 57 def self.included(base) # built-in Ruby hook for modules base.class_eval do original_method = instance_method(:initialize) define_method(:initialize) do |*args, &block| original_method.bind(self).call(*args, &block) # Update the library of existing types. # Note: no check is made so an exisiting type with a same # name is overwritten. Types[@name] = self end # Get an existing signal type by +name+. def self.get(name) # return name if name.is_a?(Type) return name if name.respond_to?(:ltype?) return Types[name.to_sym] end end end
Public Instance Methods
ltype?()
click to toggle source
Tells ltype has been included.
# File lib/HDLRuby/hruby_db.rb, line 78 def ltype? return true end