Class: Origen::Ports::PortCollection

Inherits:
Hash show all
Defined in:
lib/origen/ports/port_collection.rb

Instance Method Summary collapse

Methods inherited from Hash

#filter, #ids, #intersect?, #intersections, #longest_key, #longest_value, #recursive_find_by_key, #update_common

Instance Method Details

#add(name, port) ⇒ Object



4
5
6
7
8
# File 'lib/origen/ports/port_collection.rb', line 4

def add(name, port)
  self[name] = port
  by_type[port.type] ||= []
  by_type[port.type] << port
end

#by_typeObject



10
11
12
# File 'lib/origen/ports/port_collection.rb', line 10

def by_type
  @by_type ||= {}.with_indifferent_access
end

#inspectObject



14
15
16
# File 'lib/origen/ports/port_collection.rb', line 14

def inspect
  map { |k, _v| k }.inspect
end