Module: PactBroker::Services

Constant Summary collapse

SERVICE_FACTORIES =
{}

Instance Method Summary collapse

Instance Method Details

#badge_serviceObject



52
53
54
# File 'lib/pact_broker/services.rb', line 52

def badge_service
  get_service(:badge_service)
end

#branch_serviceObject



92
93
94
# File 'lib/pact_broker/services.rb', line 92

def branch_service
  get_service(:branch_service)
end

#certificate_serviceObject



60
61
62
# File 'lib/pact_broker/services.rb', line 60

def certificate_service
  get_service(:certificate_service)
end

#contract_serviceObject



88
89
90
# File 'lib/pact_broker/services.rb', line 88

def contract_service
  get_service(:contract_service)
end

#deployed_version_serviceObject



80
81
82
# File 'lib/pact_broker/services.rb', line 80

def deployed_version_service
  get_service(:deployed_version_service)
end

#environment_serviceObject



76
77
78
# File 'lib/pact_broker/services.rb', line 76

def environment_service
  get_service(:environment_service)
end

#get_service(name) ⇒ Object



12
13
14
# File 'lib/pact_broker/services.rb', line 12

def get_service(name)
  SERVICE_FACTORIES[name].call
end

#group_serviceObject



36
37
38
# File 'lib/pact_broker/services.rb', line 36

def group_service
  get_service(:group_service)
end

#index_serviceObject



16
17
18
# File 'lib/pact_broker/services.rb', line 16

def index_service
  get_service(:index_service)
end

#integration_serviceObject



64
65
66
# File 'lib/pact_broker/services.rb', line 64

def integration_service
  get_service(:integration_service)
end

#label_serviceObject



32
33
34
# File 'lib/pact_broker/services.rb', line 32

def label_service
  get_service(:label_service)
end

#matrix_serviceObject



56
57
58
# File 'lib/pact_broker/services.rb', line 56

def matrix_service
  get_service(:matrix_service)
end

#metrics_serviceObject



72
73
74
# File 'lib/pact_broker/services.rb', line 72

def metrics_service
  get_service(:metrics_service)
end

#pact_serviceObject



20
21
22
# File 'lib/pact_broker/services.rb', line 20

def pact_service
  get_service(:pact_service)
end

#pacticipant_serviceObject



24
25
26
# File 'lib/pact_broker/services.rb', line 24

def pacticipant_service
  get_service(:pacticipant_service)
end

#register_default_servicesObject

rubocop: disable Metrics/MethodLength



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/pact_broker/services.rb', line 97

def register_default_services
  register_service(:index_service) do
    require "pact_broker/index/service"
    Index::Service
  end

  register_service(:metrics_service) do
    require "pact_broker/metrics/service"
    Metrics::Service
  end

  register_service(:matrix_service) do
    require "pact_broker/matrix/service"
    Matrix::Service
  end

  register_service(:pact_service) do
    require "pact_broker/pacts/service"
    Pacts::Service
  end

  register_service(:pacticipant_service) do
    require "pact_broker/pacticipants/service"
    Pacticipants::Service
  end

  register_service(:tag_service) do
    require "pact_broker/tags/service"
    Tags::Service
  end

  register_service(:label_service) do
    require "pact_broker/labels/service"
    Labels::Service
  end

  register_service(:group_service) do
    require "pact_broker/groups/service"
    Groups::Service
  end

  register_service(:webhook_service) do
    require "pact_broker/webhooks/service"
    Webhooks::Service
  end

  register_service(:version_service) do
    require "pact_broker/versions/service"
    Versions::Service
  end

  register_service(:verification_service) do
    require "pact_broker/verifications/service"
    Verifications::Service
  end

  register_service(:badge_service) do
    require "pact_broker/badges/service"
    Badges::Service
  end

  register_service(:certificate_service) do
    require "pact_broker/certificates/service"
    Certificates::Service
  end

  register_service(:integration_service) do
    require "pact_broker/integrations/service"
    Integrations::Service
  end

  register_service(:webhook_trigger_service) do
    require "pact_broker/webhooks/trigger_service"
    Webhooks::TriggerService
  end

  register_service(:environment_service) do
    require "pact_broker/deployments/environment_service"
    Deployments::EnvironmentService
  end

  register_service(:deployed_version_service) do
    require "pact_broker/deployments/deployed_version_service"
    PactBroker::Deployments::DeployedVersionService
  end

  register_service(:released_version_service) do
    require "pact_broker/deployments/released_version_service"
    PactBroker::Deployments::ReleasedVersionService
  end

  register_service(:contract_service) do
    require "pact_broker/contracts/service"
    PactBroker::Contracts::Service
  end

  register_service(:branch_service) do
    require "pact_broker/versions/branch_service"
    PactBroker::Versions::BranchService
  end
end

#register_service(name, &block) ⇒ Object



8
9
10
# File 'lib/pact_broker/services.rb', line 8

def register_service(name, &block)
  SERVICE_FACTORIES[name] = block
end

#released_version_serviceObject



84
85
86
# File 'lib/pact_broker/services.rb', line 84

def released_version_service
  get_service(:released_version_service)
end

#tag_serviceObject



28
29
30
# File 'lib/pact_broker/services.rb', line 28

def tag_service
  get_service(:tag_service)
end

#verification_serviceObject



48
49
50
# File 'lib/pact_broker/services.rb', line 48

def verification_service
  get_service(:verification_service)
end

#version_serviceObject



44
45
46
# File 'lib/pact_broker/services.rb', line 44

def version_service
  get_service(:version_service)
end

#webhook_serviceObject



40
41
42
# File 'lib/pact_broker/services.rb', line 40

def webhook_service
  get_service(:webhook_service)
end

#webhook_trigger_serviceObject



68
69
70
# File 'lib/pact_broker/services.rb', line 68

def webhook_trigger_service
  get_service(:webhook_trigger_service)
end