require 'json'
require_relative '../file_fetcher'
require_relative '../output'

module Resume
  module CLI
    class ResumeDataFetcher

      def self.fetch
        new.fetch
      end

      private_class_method :new

      def fetch
        Output.plain(:gathering_resume_information)
        JSON.parse(
          FileFetcher.fetch(filename).read,
          symbolize_names: true
        )
      end

      private

      def filename
        I18n.t(:resume_data_filename, selected_locale: I18n.locale)
      end
    end
  end
end

require 'json'
require_relative '../output'
require_relative '../file_fetcher'

module Resume
  module CLI
    class ResumeDataFetcher < FileFetcher
      def self.fetch
        super("resources/resume.#{I18n.locale}.json")
      end

      def fetch
        Output.plain(:gathering_resume_information)
        resume = super
        JSON.parse(
          resume.read,
          symbolize_names: true
        )
      end
    end
  end
end

Refactor resume data fetcher to just inherit most of its functionality from file fetcher and only differentiate itself by parsing JSON
Refactor resume data fetcher to just inherit most of its functionality from file fetcher and only differentiate itself by parsing JSON
