Class: Jfrog::Saas::Log::ProcessConfig

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

#initializeProcessConfig

Returns a new instance of ProcessConfig.



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

def initialize; end

Instance Attribute Details

#historical_log_daysObject

Returns the value of attribute historical_log_days.



192
193
194
# File 'lib/jfrog/saas/log/confighandler.rb', line 192

def historical_log_days
  @historical_log_days
end

#minutes_between_runsObject

Returns the value of attribute minutes_between_runs.



192
193
194
# File 'lib/jfrog/saas/log/confighandler.rb', line 192

def minutes_between_runs
  @minutes_between_runs
end

#parallel_downloadsObject

Returns the value of attribute parallel_downloads.



192
193
194
# File 'lib/jfrog/saas/log/confighandler.rb', line 192

def parallel_downloads
  @parallel_downloads
end

#parallel_processObject

Returns the value of attribute parallel_process.



192
193
194
# File 'lib/jfrog/saas/log/confighandler.rb', line 192

def parallel_process
  @parallel_process
end

#write_logs_by_typeObject

Returns the value of attribute write_logs_by_type.



192
193
194
# File 'lib/jfrog/saas/log/confighandler.rb', line 192

def write_logs_by_type
  @write_logs_by_type
end

Class Method Details

.historical_log_daysObject



180
181
182
# File 'lib/jfrog/saas/log/confighandler.rb', line 180

def self.historical_log_days
  historical_log_days
end

.minutes_between_runsObject



188
189
190
# File 'lib/jfrog/saas/log/confighandler.rb', line 188

def self.minutes_between_runs
  minutes_between_runs
end

.parallel_downloadsObject



176
177
178
# File 'lib/jfrog/saas/log/confighandler.rb', line 176

def self.parallel_downloads
  parallel_downloads
end

.parallel_processObject



172
173
174
# File 'lib/jfrog/saas/log/confighandler.rb', line 172

def self.parallel_process
  parallel_process
end

.write_logs_by_typeObject



184
185
186
# File 'lib/jfrog/saas/log/confighandler.rb', line 184

def self.write_logs_by_type
  write_logs_by_type
end

Instance Method Details

#configure(config_file) ⇒ Object



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/jfrog/saas/log/confighandler.rb', line 196

def configure(config_file)
  config = YAML.load_file(config_file)
  self.parallel_downloads = if config['process']['parallel_process'].to_i.positive?
                              config['process']['parallel_process'].to_i
                            else
                              1
                            end

  self.parallel_downloads = if config['process']['parallel_downloads'].to_i.positive?
                              config['process']['parallel_downloads'].to_i
                            else
                              1
                            end

  self.historical_log_days = if config['process']['historical_log_days'].to_i.positive?
                               config['process']['historical_log_days'].to_i
                             else
                               1
                             end

  self.write_logs_by_type = config['process']['write_logs_by_type']

  self.minutes_between_runs = if config['process']['minutes_between_runs'].to_i.positive?
                                config['process']['minutes_between_runs'].to_i
                              else
                                180
                              end
end

#to_sObject



225
226
227
# File 'lib/jfrog/saas/log/confighandler.rb', line 225

def to_s
  "Object_id :#{object_id}, parallel_downloads: #{parallel_downloads}, historical_log_days: #{historical_log_days}, write_logs_by_type: #{write_logs_by_type}"
end