Class: Hecks::Domain::DomainBuilder::DomainModule
- Inherits:
-
Object
- Object
- Hecks::Domain::DomainBuilder::DomainModule
- Defined in:
- lib/domain_builder/domain_module.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#objects ⇒ Object
readonly
Returns the value of attribute objects.
-
#references ⇒ Object
readonly
Returns the value of attribute references.
Instance Method Summary collapse
- #head(name = nil) ⇒ Object
-
#initialize(name:) ⇒ DomainModule
constructor
A new instance of DomainModule.
- #reference(name) ⇒ Object
- #value(name) ⇒ Object
Constructor Details
#initialize(name:) ⇒ DomainModule
Returns a new instance of DomainModule.
7 8 9 10 11 |
# File 'lib/domain_builder/domain_module.rb', line 7 def initialize(name:) @name = name @objects = [] @references = [] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/domain_builder/domain_module.rb', line 5 def name @name end |
#objects ⇒ Object (readonly)
Returns the value of attribute objects.
5 6 7 |
# File 'lib/domain_builder/domain_module.rb', line 5 def objects @objects end |
#references ⇒ Object (readonly)
Returns the value of attribute references.
5 6 7 |
# File 'lib/domain_builder/domain_module.rb', line 5 def references @references end |
Instance Method Details
#head(name = nil) ⇒ Object
13 14 15 16 |
# File 'lib/domain_builder/domain_module.rb', line 13 def head(name=nil) return (@objects << Head.new(name: name)).last if name objects.find{ |o| o.is_a?(Head) } end |