Class: HecksDomainBuilder

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

#domainObject

Returns the value of attribute domain.



17
18
19
# File 'lib/domain_builder/hecks-domain-builder.rb', line 17

def domain
  @domain
end

#nameObject

Returns the value of attribute name.



17
18
19
# File 'lib/domain_builder/hecks-domain-builder.rb', line 17

def name
  @name
end

#specificationObject

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_modulesObject



26
27
28
# File 'lib/domain_builder/hecks-domain-builder.rb', line 26

def domain_modules
  @domain.domain_modules
end