Class: ServiceDefinition
- Inherits:
-
Object
- Object
- ServiceDefinition
- Defined in:
- lib/definitions/service_definition.rb
Overview
Definition of service as defined by DSL
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#id ⇒ Object
Returns the value of attribute id.
-
#listeners ⇒ Object
Returns the value of attribute listeners.
Instance Method Summary collapse
-
#initialize ⇒ ServiceDefinition
constructor
A new instance of ServiceDefinition.
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ ServiceDefinition
Returns a new instance of ServiceDefinition.
7 8 9 10 |
# File 'lib/definitions/service_definition.rb', line 7 def initialize @listeners = {} @actions = {} end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
5 6 7 |
# File 'lib/definitions/service_definition.rb', line 5 def actions @actions end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/definitions/service_definition.rb', line 5 def id @id end |
#listeners ⇒ Object
Returns the value of attribute listeners.
5 6 7 |
# File 'lib/definitions/service_definition.rb', line 5 def listeners @listeners end |
Instance Method Details
#to_hash ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/definitions/service_definition.rb', line 12 def to_hash { id: @id, listeners: @listeners.map { |k, v| v.to_hash }, actions: @actions.map { |k, v| v.to_hash }, } end |