<commit_before>require "hashie"
require "active_support/core_ext/hash/indifferent_access"
require "jsonapi_deserializer/version"

module JSONApi
  class Deserializer
    class Assocation < Hashie::Mash
      include Hashie::Extensions::MethodAccess
      include Hashie::Extensions::IndifferentAccess

      def initialize(source_hash = nil, default = nil, &blk)
        source_hash[:id] = source_hash[:id].to_s
        super
      end
    end

    class Record < Hashie::Mash
      include Hashie::Extensions::MethodAccess
      include Hashie::Extensions::IndifferentAccess
      include Hashie::Extensions::DeepFetch
    end

    def initialize(response)
      @response = response.with_indifferent_access
      @store = {}<commit_msg>Only call with_indifferent_access on an actual hash<commit_after>require 'hashie'
require 'active_support/core_ext/hash/indifferent_access'
require 'jsonapi_deserializer/version'

module JSONApi
  class Deserializer
    class Assocation < Hashie::Mash
      include Hashie::Extensions::MethodAccess
      include Hashie::Extensions::IndifferentAccess

      def initialize(source_hash = nil, default = nil, &blk)
        source_hash[:id] = source_hash[:id].to_s
        super
      end
    end

    class Record < Hashie::Mash
      include Hashie::Extensions::MethodAccess
      include Hashie::Extensions::IndifferentAccess
      include Hashie::Extensions::DeepFetch
    end

    def initialize(response)
      @response = response.is_a?(Hash) ? response.with_indifferent_access : response
      @store = {}
{'fraction_non_alphanumeric': 0.08527131782945736, 'fraction_numerical': 0.0, 'mean_word_length': 3.901898734177215, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '4909475', 'n_tokens_mistral': 431, 'n_tokens_neox': 425, 'n_words': 94}