lib/search.rb
def read_json_file
    file_name_and_extension = [file_selection_opts[@selected_file], file_processor.file_ext].join
    file_full_path = File.join(file_processor.file_path, file_name_and_extension)
    @content = JSON.parse(File.read(file_full_path))
    content_keys = content.first.keys
    @content_fields_hash = Hash[(1..content_keys.size).zip content_keys]
    get_field_name
  end
# This method reads the JSON content and extracts the field names
This method reads the JSON content and extracts the field names
This method reads the JSON content and extracts the field names
def read_json_file
    file_name_and_extension = [file_selection_opts[@selected_file], file_processor.file_ext].join
    file_full_path = File.join(file_processor.file_path, file_name_and_extension)
    @content = JSON.parse(File.read(file_full_path))
    content_keys = content.first.keys
    @content_fields_hash = Hash[(1..content_keys.size).zip content_keys]
    get_field_name
  end
def read_json_file file_name_and_extension = [ file_selection_opts [ @selected_file ] , file_processor . file_ext ] . join file_full_path = File . join ( file_processor . file_path , file_name_and_extension ) @content = JSON . parse ( File . read ( file_full_path ) ) content_keys = content . first . keys @content_fields_hash = Hash [ ( 1 .. content_keys . size ) . zip content_keys ] get_field_name end
This method reads the JSON content and extracts the field names
This method reads the JSON content and extracts the field names