Class: Application
Instance Method Summary
collapse
config, config_consul, config_rest, random_name
Constructor Details
#initialize(rests = [], config = {}) ⇒ Application
Returns a new instance of Application.
14
15
16
17
|
# File 'lib/sample_core_api.rb', line 14
def initialize(rests=[], config={})
@config = config
@rests = rests
end
|
Instance Method Details
#init_rest_service ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/sample_core_api.rb', line 19
def init_rest_service
rests = @rests
return Sinatra.new {
rests.each {|a| use a}
not_found do
JSON RestService.error_response('EntityNotFound')
end
}
end
|
#start ⇒ Object
33
34
35
36
37
38
|
# File 'lib/sample_core_api.rb', line 33
def start
puts 'start'
Container["consul_service"].start
Container["cassandra_service"].start
init_rest_service
end
|
#stop ⇒ Object
40
41
42
43
|
# File 'lib/sample_core_api.rb', line 40
def stop
Container["consul_service"].stop
Container["cassandra_service"].stop
end
|