Class: Jfrog::Saas::Log::ConnectionConfig
- Inherits:
-
Object
- Object
- Jfrog::Saas::Log::ConnectionConfig
- Includes:
- Singleton
- Defined in:
- lib/jfrog/saas/log/confighandler.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#end_point_base ⇒ Object
Returns the value of attribute end_point_base.
-
#ignore_errors_in_response ⇒ Object
Returns the value of attribute ignore_errors_in_response.
-
#jpd_url ⇒ Object
Returns the value of attribute jpd_url.
-
#open_timeout_in_secs ⇒ Object
Returns the value of attribute open_timeout_in_secs.
-
#read_timeout_in_secs ⇒ Object
Returns the value of attribute read_timeout_in_secs.
-
#username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
- .access_token ⇒ Object
- .api_key ⇒ Object
- .end_point_base ⇒ Object
- .ignore_errors_in_response ⇒ Object
- .jpd_url ⇒ Object
- .open_timeout_in_secs ⇒ Object
- .read_timeout_in_secs ⇒ Object
- .username ⇒ Object
Instance Method Summary collapse
- #configure(config_file) ⇒ Object
-
#initialize ⇒ ConnectionConfig
constructor
A new instance of ConnectionConfig.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ ConnectionConfig
Returns a new instance of ConnectionConfig.
140 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 140 def initialize; end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
138 139 140 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 138 def access_token @access_token end |
#api_key ⇒ Object
Returns the value of attribute api_key.
138 139 140 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 138 def api_key @api_key end |
#end_point_base ⇒ Object
Returns the value of attribute end_point_base.
138 139 140 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 138 def end_point_base @end_point_base end |
#ignore_errors_in_response ⇒ Object
Returns the value of attribute ignore_errors_in_response.
138 139 140 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 138 def ignore_errors_in_response @ignore_errors_in_response end |
#jpd_url ⇒ Object
Returns the value of attribute jpd_url.
138 139 140 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 138 def jpd_url @jpd_url end |
#open_timeout_in_secs ⇒ Object
Returns the value of attribute open_timeout_in_secs.
138 139 140 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 138 def open_timeout_in_secs @open_timeout_in_secs end |
#read_timeout_in_secs ⇒ Object
Returns the value of attribute read_timeout_in_secs.
138 139 140 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 138 def read_timeout_in_secs @read_timeout_in_secs end |
#username ⇒ Object
Returns the value of attribute username.
138 139 140 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 138 def username @username end |
Class Method Details
.access_token ⇒ Object
118 119 120 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 118 def self.access_token access_token end |
.api_key ⇒ Object
122 123 124 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 122 def self.api_key api_key end |
.end_point_base ⇒ Object
110 111 112 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 110 def self.end_point_base end_point_base end |
.ignore_errors_in_response ⇒ Object
126 127 128 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 126 def self.ignore_errors_in_response ignore_errors_in_response end |
.jpd_url ⇒ Object
106 107 108 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 106 def self.jpd_url jpd_url end |
.open_timeout_in_secs ⇒ Object
130 131 132 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 130 def self.open_timeout_in_secs open_timeout_in_secs end |
.read_timeout_in_secs ⇒ Object
134 135 136 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 134 def self.read_timeout_in_secs read_timeout_in_secs end |
.username ⇒ Object
114 115 116 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 114 def self.username username end |
Instance Method Details
#configure(config_file) ⇒ Object
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 142 def configure(config_file) config = YAML.load_file(config_file) self.jpd_url = (config['connection']['jpd_url']).to_s.strip self.username = (config['connection']['username']).to_s.strip self.access_token = (config['connection']['access_token']).to_s.strip self.end_point_base = (config['connection']['end_point_base']).to_s.strip self.api_key = (config['connection']['api_key']).to_s.strip self.ignore_errors_in_response = (config['connection']['ignore_errors_in_response']) self.open_timeout_in_secs = if config['connection']['open_timeout_in_secs'].to_i.positive? config['connection']['open_timeout_in_secs'].to_i else 5 end self.read_timeout_in_secs = if config['connection']['read_timeout_in_secs'].to_i.positive? config['connection']['read_timeout_in_secs'].to_i else 60 end end |
#to_s ⇒ Object
164 165 166 |
# File 'lib/jfrog/saas/log/confighandler.rb', line 164 def to_s "Object_id :#{object_id}, jpd_url :#{jpd_url}, username:#{username}, access_token: #{access_token}, end_point_base:#{end_point_base}, api_key:#{api_key}" end |