Class: Application
Instance Method Summary
collapse
config, config_cassandra, config_consul, config_rest, random_name
Constructor Details
#initialize(rests = [], config = {}) ⇒ Application
Returns a new instance of Application.
16
17
18
19
|
# File 'lib/blsk_ruby_core_api.rb', line 16
def initialize(rests=[], config={})
@config = config
@rests = rests
end
|
Instance Method Details
#init_rest_service ⇒ Object
21
22
23
24
25
26
27
28
29
|
# File 'lib/blsk_ruby_core_api.rb', line 21
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
31
32
33
34
35
|
# File 'lib/blsk_ruby_core_api.rb', line 31
def start
puts 'start'
Container['app_service'].start
init_rest_service
end
|
#stop ⇒ Object
37
38
39
|
# File 'lib/blsk_ruby_core_api.rb', line 37
def stop
Container['app_service'].stop
end
|