Class: RgGen::VHDL::Utility::DataObject
- Inherits:
-
Object
- Object
- RgGen::VHDL::Utility::DataObject
- Includes:
- Core::Utility::AttributeSetter
- Defined in:
- lib/rggen/vhdl/utility/data_object.rb
Instance Method Summary collapse
- #declaration ⇒ Object
- #identifier ⇒ Object
-
#initialize(object_type, default_attributes = {}) ⇒ DataObject
constructor
A new instance of DataObject.
Constructor Details
#initialize(object_type, default_attributes = {}) ⇒ DataObject
Returns a new instance of DataObject.
9 10 11 12 13 |
# File 'lib/rggen/vhdl/utility/data_object.rb', line 9 def initialize(object_type, default_attributes = {}) @object_type = object_type apply_attributes(**default_attributes) block_given? && yield(self) end |
Instance Method Details
#declaration ⇒ Object
22 23 24 25 26 27 |
# File 'lib/rggen/vhdl/utility/data_object.rb', line 22 def declaration declaration_snippets .compact .reject(&:empty?) .join(' ') end |
#identifier ⇒ Object
29 30 31 32 33 34 |
# File 'lib/rggen/vhdl/utility/data_object.rb', line 29 def identifier Identifier.new(name) do |identifier| identifier.__width__(width) identifier.__array_size__(array_size) end end |