Class: HecksDomain::Parser
- Inherits:
-
Object
- Object
- HecksDomain::Parser
show all
- Defined in:
- lib/hecks/domain/parser.rb,
lib/hecks/domain/parser/fields.rb,
lib/hecks/domain/parser/aggregate.rb,
lib/hecks/domain/parser/operation.rb,
lib/hecks/domain/parser/list_field.rb,
lib/hecks/domain/parser/value_field.rb,
lib/hecks/domain/parser/entity_field.rb,
lib/hecks/domain/parser/domain_object.rb,
lib/hecks/domain/parser/reference_field.rb
Defined Under Namespace
Classes: Aggregate, BooleanField, CurrencyField, DomainObject, Entity, EntityField, IntegerField, ListField, Operation, ReferenceField, Root, StringField, ValueField, ValueObject
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(name, &block) ⇒ Parser
Returns a new instance of Parser.
17
18
19
20
21
22
|
# File 'lib/hecks/domain/parser.rb', line 17
def initialize(name, &block)
@name = name
@aggregates = []
@domain_version = nil
instance_eval(&block)
end
|
Instance Attribute Details
#aggregates ⇒ Object
Returns the value of attribute aggregates.
14
15
16
|
# File 'lib/hecks/domain/parser.rb', line 14
def aggregates
@aggregates
end
|
#factory_loader ⇒ Object
Returns the value of attribute factory_loader.
14
15
16
|
# File 'lib/hecks/domain/parser.rb', line 14
def factory_loader
@factory_loader
end
|
#name ⇒ Object
Returns the value of attribute name.
14
15
16
|
# File 'lib/hecks/domain/parser.rb', line 14
def name
@name
end
|
#repository_helper ⇒ Object
Returns the value of attribute repository_helper.
14
15
16
|
# File 'lib/hecks/domain/parser.rb', line 14
def repository_helper
@repository_helper
end
|
#spec_helper ⇒ Object
Returns the value of attribute spec_helper.
14
15
16
|
# File 'lib/hecks/domain/parser.rb', line 14
def spec_helper
@spec_helper
end
|
#string_support ⇒ Object
Returns the value of attribute string_support.
14
15
16
|
# File 'lib/hecks/domain/parser.rb', line 14
def string_support
@string_support
end
|
Instance Method Details
#aggregate(name, &block) ⇒ Object
59
60
61
|
# File 'lib/hecks/domain/parser.rb', line 59
def aggregate(name, &block)
@aggregates << Aggregate.new(name, self, &block)
end
|
#authors(value) ⇒ Object
47
48
49
|
# File 'lib/hecks/domain/parser.rb', line 47
def authors(value)
@authors = value
end
|
#binding ⇒ Object
63
64
65
|
# File 'lib/hecks/domain/parser.rb', line 63
def binding
super
end
|
#description(value) ⇒ Object
28
29
30
|
# File 'lib/hecks/domain/parser.rb', line 28
def description(value)
@description = value
end
|
#domain_version(value) ⇒ Object
75
76
77
|
# File 'lib/hecks/domain/parser.rb', line 75
def domain_version(value)
@domain_version = value
end
|
#email(value) ⇒ Object
51
52
53
|
# File 'lib/hecks/domain/parser.rb', line 51
def email(value)
@email = value
end
|
#file_name ⇒ Object
67
68
69
|
# File 'lib/hecks/domain/parser.rb', line 67
def file_name
@file_name = folder_name + '.rb'
end
|
#folder_name ⇒ Object
71
72
73
|
# File 'lib/hecks/domain/parser.rb', line 71
def folder_name
@folder_name = @name.to_s.underscore
end
|
#for_each_domain_object ⇒ Object
79
80
81
82
83
84
85
|
# File 'lib/hecks/domain/parser.rb', line 79
def for_each_domain_object
aggregates.each do |aggregate|
aggregate.domain_objects.each do |domain_object|
yield aggregate, domain_object
end
end
end
|
#for_each_operation ⇒ Object
87
88
89
90
91
92
93
|
# File 'lib/hecks/domain/parser.rb', line 87
def for_each_operation
for_each_domain_object do |aggregate, domain_object|
domain_object.operations_get.each do |operation|
yield aggregate, domain_object, operation
end
end
end
|
#gemspec ⇒ Object
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/hecks/domain/parser.rb', line 36
def gemspec
{
summary: @summary,
description: @description,
version: @version,
authors: @authors,
email: @email,
homepage: @homepage
}
end
|
#homepage(value) ⇒ Object
55
56
57
|
# File 'lib/hecks/domain/parser.rb', line 55
def homepage(value)
@homepage = value
end
|
#summary(value) ⇒ Object
24
25
26
|
# File 'lib/hecks/domain/parser.rb', line 24
def summary(value)
@summary = value
end
|
#version(value) ⇒ Object
32
33
34
|
# File 'lib/hecks/domain/parser.rb', line 32
def version(value)
@version = value
end
|