Class: Stackify::EnvDetails

Inherits:
Object show all
Includes:
Singleton
Defined in:
lib/stackify/env_details.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEnvDetails

Returns a new instance of EnvDetails.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/stackify/env_details.rb', line 9

def initialize
  rails_info = defined?(Rails) ? Rails::Info.properties.to_h : nil
  @info =  rails_info || { 'Application root' => Dir.pwd, 'Environment' => 'development'}
  @request_details = {}
  @app_name = app_name
  app_location = Stackify.configuration.app_location || @info['Application root']
  @details = {
    'DeviceName' => Socket.gethostname,
    'AppLocation' => app_location,
    'AppName' => @app_name,
    'ConfiguredAppName' => @app_name,
    'ConfiguredEnvironmentName' =>@info['Environment']
  }
end

Instance Attribute Details

#request_detailsObject

Returns the value of attribute request_details.



7
8
9
# File 'lib/stackify/env_details.rb', line 7

def request_details
  @request_details
end

Instance Method Details

#auth_infoObject



24
25
26
# File 'lib/stackify/env_details.rb', line 24

def auth_info
  with_synchronize{ @details }
end

#update_auth_info(info) ⇒ Object



28
29
30
# File 'lib/stackify/env_details.rb', line 28

def update_auth_info info
  with_synchronize{ @details.merge! info }
end