Class: HecksDomainBuilder
- Inherits:
-
Object
- Object
- HecksDomainBuilder
- Defined in:
- lib/domain_builder/hecks-domain-builder.rb,
lib/domain_builder/head.rb,
lib/domain_builder/value.rb,
lib/domain_builder/domain.rb,
lib/domain_builder/attribute.rb,
lib/domain_builder/reference.rb,
lib/domain_builder/domain_module.rb,
lib/domain_builder/domain_object.rb
Overview
Represents information about your domain
Defined Under Namespace
Classes: Attribute, Domain, DomainModule, DomainObject, Head, Reference, Value
Instance Attribute Summary collapse
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#name ⇒ Object
Returns the value of attribute name.
-
#specification ⇒ Object
Returns the value of attribute specification.
Class Method Summary collapse
Instance Method Summary collapse
- #[](module_name) ⇒ Object
- #domain_modules ⇒ Object
-
#initialize(domain_name:, &block) ⇒ HecksDomainBuilder
constructor
A new instance of HecksDomainBuilder.
Constructor Details
#initialize(domain_name:, &block) ⇒ HecksDomainBuilder
Returns a new instance of HecksDomainBuilder.
19 20 21 22 23 24 |
# File 'lib/domain_builder/hecks-domain-builder.rb', line 19 def initialize(domain_name:, &block) @name = domain_name @domain = Domain.new(name: domain_name) block.yield(@domain) self end |
Instance Attribute Details
#domain ⇒ Object
Returns the value of attribute domain.
17 18 19 |
# File 'lib/domain_builder/hecks-domain-builder.rb', line 17 def domain @domain end |
#name ⇒ Object
Returns the value of attribute name.
17 18 19 |
# File 'lib/domain_builder/hecks-domain-builder.rb', line 17 def name @name end |
#specification ⇒ Object
Returns the value of attribute specification.
17 18 19 |
# File 'lib/domain_builder/hecks-domain-builder.rb', line 17 def specification @specification end |
Class Method Details
.build(domain_name, &block) ⇒ Object
34 35 36 |
# File 'lib/domain_builder/hecks-domain-builder.rb', line 34 def self.build(domain_name, &block) new(domain_name: domain_name, &block) end |
Instance Method Details
#[](module_name) ⇒ Object
30 31 32 |
# File 'lib/domain_builder/hecks-domain-builder.rb', line 30 def [](module_name) domain_modules[module_name] end |
#domain_modules ⇒ Object
26 27 28 |
# File 'lib/domain_builder/hecks-domain-builder.rb', line 26 def domain_modules @domain.domain_modules end |