Class: StackAgent::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/stack-agent/configuration.rb

Constant Summary collapse

DEFAULT_API_HOST =
'https://stackotron-discover.herokuapp.com'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



13
14
15
16
17
18
19
20
21
22
# File 'lib/stack-agent/configuration.rb', line 13

def initialize
  @api_host = DEFAULT_API_HOST
  @name = Socket.gethostname

  # If we're running inside rails, attempt to fill in a bunch of the blanks
  if defined?(Rails) && Rails.env.development?
    @group = 'Development'
    @uri = "http://#{ip}:#{port}" if port
  end
end

Instance Attribute Details

#api_hostObject

Returns the value of attribute api_host.



7
8
9
# File 'lib/stack-agent/configuration.rb', line 7

def api_host
  @api_host
end

#app_tokenObject

Returns the value of attribute app_token.



8
9
10
# File 'lib/stack-agent/configuration.rb', line 8

def app_token
  @app_token
end

#groupObject

Returns the value of attribute group.



10
11
12
# File 'lib/stack-agent/configuration.rb', line 10

def group
  @group
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/stack-agent/configuration.rb', line 9

def name
  @name
end

#uriObject

Returns the value of attribute uri.



11
12
13
# File 'lib/stack-agent/configuration.rb', line 11

def uri
  @uri
end