<commit_before>require_relative './client_ext/request'
require 'faraday'

module Nard

  module Appi

    class Client

      include Nard::Appi::ClientExt::Request

      def initialize( gem_top_namespace, options = {} )
        options_keys = gem_top_namespace::OPTIONS_KEYS

        self.class.instance_eval do
          set_attr_accessor( options_keys )
        end

        options = gem_top_namespace.options.merge( options ).with_indifferent_access

        options_keys.each do | key |
          send( "#{ key }=", options[ key ] )
        end
      end

      def self.set_attr_accessor( options_keys )
        return if @_attr_accessor_defined

        options_keys.each do | option_key |
          getter_method = option_key.to_sym
          setter_method = "#{ option_key }=".to_sym
          writer = option_key.to_sym
          attr_reader getter_method unless getter_method.in?( self.class.instance_methods )
          attr_writer writer unless setter_method.in?( self.class.instance_methods )
        end

        @_attr_accessor_defined = true
      end

    end
  end
end<commit_msg>20161204_162420 Update - [Lib] Rename method Nard::Appi::Client.#set_attr_accessor -> .#set_attr_accessors<commit_after>require_relative './client_ext/request'
require 'faraday'

module Nard

  module Appi

    class Client

      include Nard::Appi::ClientExt::Request

      def initialize( gem_top_namespace, options = {} )
        options_keys = gem_top_namespace::OPTIONS_KEYS

        self.class.instance_eval do
          set_attr_accessors( options_keys )
        end

        options = gem_top_namespace.options.merge( options ).with_indifferent_access

        options_keys.each do | key |
          send( "#{ key }=", options[ key ] )
        end
      end

      def self.set_attr_accessors( options_keys )
        return if @_attr_accessors_defined

        options_keys.each do | option_key |
          getter_method = option_key.to_sym
          setter_method = "#{ option_key }=".to_sym
          writer = option_key.to_sym
          attr_reader getter_method unless getter_method.in?( self.class.instance_methods )
          attr_writer writer unless setter_method.in?( self.class.instance_methods )
        end

        @_attr_accessors_defined = true
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.07698999565028274, 'fraction_numerical': 0.006089604175728578, 'mean_word_length': 2.5881435257410295, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6576953', 'n_tokens_mistral': 711, 'n_tokens_neox': 680, 'n_words': 143}