<commit_before>require 'net/http'
require_relative '../rest_client_factory'
require_relative '../responses/generic_response'

module NoaaClient
  module RestService
    def object_from_response(action, url, options = {})
      response_class = options.fetch(:response_class, Responses::GenericResponse)
      client = options.fetch(:client, RestClientFactory.build_client(url: url))
      request = build_request_for_action action, url, options
      response_class.new client.request(request).body
    rescue Exception => e
      puts e 
      # return failure response
    end

    # @note Much more to be done here when needed.
    def build_request_for_action(action, url, options = {})
      r_class = case action
                when :get then Net::HTTP::Get
                when :post then Net::HTTP::Post
                end
      r_class.new url
    end
  end
end<commit_msg>Remove unused code branch.<commit_after>require 'net/http'
require_relative '../rest_client_factory'
require_relative '../responses/generic_response'

module NoaaClient
  module RestService
    def object_from_response(action, url, options = {})
      response_class = options.fetch(:response_class, Responses::GenericResponse)
      client = options.fetch(:client, RestClientFactory.build_client(url: url))
      request = build_request_for_action action, url, options
      response_class.new client.request(request).body
    rescue Exception => e
      puts e 
      # return failure response
    end

    # @note Much more to be done here when needed.
    def build_request_for_action(action, url, options = {})
      r_class = case action
                when :get then Net::HTTP::Get
                end
      r_class.new url
    end
  end
end
{'fraction_non_alphanumeric': 0.08424697057126371, 'fraction_numerical': 0.0, 'mean_word_length': 3.08, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6188731', 'n_tokens_mistral': 476, 'n_tokens_neox': 472, 'n_words': 132}