Class: Rhdl::TopDsl
- Inherits:
-
Object
- Object
- Rhdl::TopDsl
- Defined in:
- lib/rhdl/top_dsl.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
Instance Method Summary collapse
- #component(name, &block) ⇒ Object
-
#initialize ⇒ TopDsl
constructor
A new instance of TopDsl.
Constructor Details
#initialize ⇒ TopDsl
4 5 6 7 8 9 |
# File 'lib/rhdl/top_dsl.rb', line 4 def initialize @components = {} @contents = { components: @components } end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
3 4 5 |
# File 'lib/rhdl/top_dsl.rb', line 3 def contents @contents end |
Instance Method Details
#component(name, &block) ⇒ Object
11 12 13 14 15 |
# File 'lib/rhdl/top_dsl.rb', line 11 def component(name, &block) raise "component '#{name}' already defined" if @components[name] @components[name] = Component.new(name, self, Proc.new(&block)) end |