<commit_before><commit_msg>Added a Generic model to convert help convert view objects<commit_after>module Metro
  class Generic

    attr_accessor :window

    def initialize(options = {})
      options.each do |raw_key,value|

        key = raw_key.dup
        key.gsub!(/-/,'_')
        key.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
        key.gsub!(/([a-z\d])([A-Z])/,'\1_\2')

        unless respond_to? key
          self.class.send :define_method, key do
            instance_variable_get("@#{key}")
          end
        end

        unless respond_to? "#{key}="
          self.class.send :define_method, "#{key}=" do |value|
            instance_variable_set("@#{key}",value)
          end
        end

        send "#{key}=", value
      end
    end

  end
end

{'fraction_non_alphanumeric': 0.16124837451235371, 'fraction_numerical': 0.005201560468140442, 'mean_word_length': 2.019607843137255, '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': '4292181', 'n_tokens_mistral': 262, 'n_tokens_neox': 258, 'n_words': 53}