Class: Logical::Naf::LogParser::JobDownloader

Inherits:
Base
  • Object
show all
Defined in:
app/models/logical/naf/log_parser/job_downloader.rb

Constant Summary

Constants inherited from Base

Base::DATE_REGEX, Base::LOG_SIZE_CHUNKS, Base::REGEX_OPTIONS, Base::UUID_REGEX

Instance Attribute Summary

Attributes inherited from Base

#grep, #jsons, #last_file_checked, #log_type, #logs_size, #newest_file_checked, #newest_log, #read_from_s3, #record_id, #regex_options, #s3_log_reader, #search_from_time, #search_params, #search_to_time

Instance Method Summary collapse

Methods inherited from Base

#build_time_string, #check_repeated_logs, #filter_files, #filter_log_messages, #get_json_from_log_file, #get_option_value, #get_s3_files, #log_within_time_range, #parse_files, #parse_log, #retrieve_logs, #update_last_file_checked

Constructor Details

#initialize(params) ⇒ JobDownloader

Description: Initializes instance variables for the class params: Params must include ‘record_id’ key/value Note: Only uses record_id from params



26
27
28
29
30
# File 'app/models/logical/naf/log_parser/job_downloader.rb', line 26

def initialize(params)
  @jsons = []
  @record_id = params['record_id']
  @read_from_s3 = true;
end

Instance Method Details

#logs_for_downloadObject

Description: Public method used to return a string of all logs

The string contains all parsed json elements from all
accessible files (local and s3) for @record_id

Returns: String (of logs)



36
37
38
# File 'app/models/logical/naf/log_parser/job_downloader.rb', line 36

def logs_for_download
  retrieve_logs_for_download
end