Class: Jfrog::Saas::Log::ConnectionConfig

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/jfrog/saas/log/confighandler.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConnectionConfig

Returns a new instance of ConnectionConfig.



140
# File 'lib/jfrog/saas/log/confighandler.rb', line 140

def initialize; end

Instance Attribute Details

#access_tokenObject

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_keyObject

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_baseObject

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_responseObject

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_urlObject

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_secsObject

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_secsObject

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

#usernameObject

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_tokenObject



118
119
120
# File 'lib/jfrog/saas/log/confighandler.rb', line 118

def self.access_token
  access_token
end

.api_keyObject



122
123
124
# File 'lib/jfrog/saas/log/confighandler.rb', line 122

def self.api_key
  api_key
end

.end_point_baseObject



110
111
112
# File 'lib/jfrog/saas/log/confighandler.rb', line 110

def self.end_point_base
  end_point_base
end

.ignore_errors_in_responseObject



126
127
128
# File 'lib/jfrog/saas/log/confighandler.rb', line 126

def self.ignore_errors_in_response
  ignore_errors_in_response
end

.jpd_urlObject



106
107
108
# File 'lib/jfrog/saas/log/confighandler.rb', line 106

def self.jpd_url
  jpd_url
end

.open_timeout_in_secsObject



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_secsObject



134
135
136
# File 'lib/jfrog/saas/log/confighandler.rb', line 134

def self.read_timeout_in_secs
  read_timeout_in_secs
end

.usernameObject



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_sObject



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