Class: Stackify::EnvDetails
- Includes:
- Singleton
- Defined in:
- lib/stackify/env_details.rb
Instance Attribute Summary collapse
-
#request_details ⇒ Object
Returns the value of attribute request_details.
Instance Method Summary collapse
- #auth_info ⇒ Object
-
#initialize ⇒ EnvDetails
constructor
A new instance of EnvDetails.
- #update_auth_info(info) ⇒ Object
Constructor Details
#initialize ⇒ EnvDetails
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_details ⇒ Object
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_info ⇒ Object
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 |