Class: ServiceDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/definitions/service_definition.rb

Overview

Definition of service as defined by DSL

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeServiceDefinition

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

#actionsObject

Returns the value of attribute actions.



5
6
7
# File 'lib/definitions/service_definition.rb', line 5

def actions
  @actions
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/definitions/service_definition.rb', line 5

def id
  @id
end

#listenersObject

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_hashObject



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