<commit_before>require 'pathname'

module Akabei
  module AttrPath
    def attr_path_writer(*attrs)
      attrs.each do |attr|
        define_method("#{attr}=") do |val|
          instance_variable_set("@#{attr}", Pathname.new(val))
        end
      end
    end

    def attr_path_accessor(*attrs)
      attr_reader *attrs
      attr_path_writer *attrs
    end
  end
end<commit_msg>Ignore nil value<commit_after>require 'pathname'

module Akabei
  module AttrPath
    def attr_path_writer(*attrs)
      attrs.each do |attr|
        define_method("#{attr}=") do |val|
          unless val.nil?
            instance_variable_set("@#{attr}", Pathname.new(val))
          end
        end
      end
    end

    def attr_path_accessor(*attrs)
      attr_reader *attrs
      attr_path_writer *attrs
    end
  end
end
{'fraction_non_alphanumeric': 0.09617755856966707, 'fraction_numerical': 0.0, 'mean_word_length': 2.515151515151515, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7623866', 'n_tokens_mistral': 261, 'n_tokens_neox': 262, 'n_words': 60}