Class: Staccato::Proxy::Supervisor

Inherits:
Object
  • Object
show all
Defined in:
lib/staccato/proxy/supervisor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Supervisor



5
6
7
# File 'lib/staccato/proxy/supervisor.rb', line 5

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/staccato/proxy/supervisor.rb', line 3

def options
  @options
end

Instance Method Details

#debug?Boolean



21
22
23
# File 'lib/staccato/proxy/supervisor.rb', line 21

def debug?
  options.fetch(:debug, false)
end

#hostObject



9
10
11
# File 'lib/staccato/proxy/supervisor.rb', line 9

def host
  options.fetch(:host, '0.0.0.0')
end

#portObject



13
14
15
# File 'lib/staccato/proxy/supervisor.rb', line 13

def port
  options.fetch(:port, 9090)
end

#runObject



25
26
27
28
# File 'lib/staccato/proxy/supervisor.rb', line 25

def run
  config.deploy
  self
end

#terminateObject



30
31
32
# File 'lib/staccato/proxy/supervisor.rb', line 30

def terminate
  config.shutdown
end

#urlObject



17
18
19
# File 'lib/staccato/proxy/supervisor.rb', line 17

def url
  options.fetch(:url, GA_COLLECTION_URL)
end