Class: RgGen::VerilogUtility::PackageDefinition::ImportedPackage

Inherits:
Struct
  • Object
show all
Defined in:
lib/rggen/core_components/verilog_utility/package_definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#itemsObject

Returns the value of attribute items

Returns:

  • (Object)

    the current value of items



4
5
6
# File 'lib/rggen/core_components/verilog_utility/package_definition.rb', line 4

def items
  @items
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/rggen/core_components/verilog_utility/package_definition.rb', line 4

def name
  @name
end

Instance Method Details

#import_itemsObject



9
10
11
12
13
# File 'lib/rggen/core_components/verilog_utility/package_definition.rb', line 9

def import_items
  (((items.nil? || items.empty?) && [:*]) || items).map do |item|
    "#{name}::#{item}"
  end
end

#to_sObject



5
6
7
# File 'lib/rggen/core_components/verilog_utility/package_definition.rb', line 5

def to_s
  "import #{import_items.join(', ')};"
end