Class: HecksDomainBuilder::Domain
- Inherits:
-
Object
- Object
- HecksDomainBuilder::Domain
- Defined in:
- lib/domain_builder/domain.rb
Overview
A domain
Instance Attribute Summary collapse
-
#domain_modules ⇒ Object
readonly
Returns the value of attribute domain_modules.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:) ⇒ Domain
constructor
A new instance of Domain.
- #module(name) {|result| ... } ⇒ Object
Constructor Details
#initialize(name:) ⇒ Domain
Returns a new instance of Domain.
5 6 7 8 |
# File 'lib/domain_builder/domain.rb', line 5 def initialize(name:) @name = name @domain_modules = {} end |
Instance Attribute Details
#domain_modules ⇒ Object (readonly)
Returns the value of attribute domain_modules.
4 5 6 |
# File 'lib/domain_builder/domain.rb', line 4 def domain_modules @domain_modules end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/domain_builder/domain.rb', line 4 def name @name end |
Instance Method Details
#module(name) {|result| ... } ⇒ Object
10 11 12 13 14 |
# File 'lib/domain_builder/domain.rb', line 10 def module(name, &block) result = DomainModule.new(name: name) @domain_modules[name.to_sym] = result yield(result) end |