Class: DomainEvent
- Inherits:
-
Object
- Object
- DomainEvent
- Defined in:
- lib/apollo_commons_ruby/DomainEvent.rb
Instance Attribute Summary collapse
-
#eventName ⇒ Object
readonly
Returns the value of attribute eventName.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#projectId ⇒ Object
readonly
Returns the value of attribute projectId.
-
#requestBody ⇒ Object
readonly
Returns the value of attribute requestBody.
-
#tenantId ⇒ Object
readonly
Returns the value of attribute tenantId.
-
#topic ⇒ Object
readonly
Returns the value of attribute topic.
-
#viewGroupComponent ⇒ Object
readonly
Returns the value of attribute viewGroupComponent.
-
#viewGroupDefinition ⇒ Object
readonly
Returns the value of attribute viewGroupDefinition.
Instance Method Summary collapse
-
#initialize(configuration_json, view_group_definition, view_group_component, topic, event_name) ⇒ DomainEvent
constructor
A new instance of DomainEvent.
Constructor Details
#initialize(configuration_json, view_group_definition, view_group_component, topic, event_name) ⇒ DomainEvent
Returns a new instance of DomainEvent.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/apollo_commons_ruby/DomainEvent.rb', line 32 def initialize(configuration_json, view_group_definition, view_group_component, topic, event_name) @tenantId = configuration_json["tenantId"] @projectId = configuration_json["projectId"] @viewGroupDefinition = view_group_definition @viewGroupComponent = view_group_component @topic = topic @eventName = event_name @location = "./configs/" + view_group_definition + "/" + view_group_component + "/" + topic + "/" + event_name begin domain_event_properties = File.read(location + "/domain_event_properties.json") @requestBody = JSON.parse domain_event_properties rescue @requestBody = JSON.parse '{}' end @requestBody["tenantId"] = configuration_json["tenantId"] @requestBody["projectId"] = configuration_json["projectId"] @requestBody["viewGroupDefinition"] = view_group_definition @requestBody["component"] = view_group_component @requestBody["topic"] = topic @requestBody["domainEventName"] = event_name end |
Instance Attribute Details
#eventName ⇒ Object (readonly)
Returns the value of attribute eventName.
28 29 30 |
# File 'lib/apollo_commons_ruby/DomainEvent.rb', line 28 def eventName @eventName end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
30 31 32 |
# File 'lib/apollo_commons_ruby/DomainEvent.rb', line 30 def location @location end |
#projectId ⇒ Object (readonly)
Returns the value of attribute projectId.
24 25 26 |
# File 'lib/apollo_commons_ruby/DomainEvent.rb', line 24 def projectId @projectId end |
#requestBody ⇒ Object (readonly)
Returns the value of attribute requestBody.
29 30 31 |
# File 'lib/apollo_commons_ruby/DomainEvent.rb', line 29 def requestBody @requestBody end |
#tenantId ⇒ Object (readonly)
Returns the value of attribute tenantId.
23 24 25 |
# File 'lib/apollo_commons_ruby/DomainEvent.rb', line 23 def tenantId @tenantId end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
27 28 29 |
# File 'lib/apollo_commons_ruby/DomainEvent.rb', line 27 def topic @topic end |
#viewGroupComponent ⇒ Object (readonly)
Returns the value of attribute viewGroupComponent.
26 27 28 |
# File 'lib/apollo_commons_ruby/DomainEvent.rb', line 26 def viewGroupComponent @viewGroupComponent end |
#viewGroupDefinition ⇒ Object (readonly)
Returns the value of attribute viewGroupDefinition.
25 26 27 |
# File 'lib/apollo_commons_ruby/DomainEvent.rb', line 25 def viewGroupDefinition @viewGroupDefinition end |