<commit_before>module C2y
  class DSL::Context::Unit
    attr_reader :result

    def initialize(name, &block)
      @result = OpenStruct.new({
        name: name
      })

      instance_eval(&block)
    end

    private

    def command(unit_command)
      @result.command = unit_command.to_s
    end

    def content(unit_content)
      @result.content = unit_content
    end

    def enable(unit_enable)
      @result.enable = unit_enable
    end
  end
end<commit_msg>Use dynamic method definition in Unit<commit_after>module C2y
  class DSL::Context::Unit
    attr_reader :result

    def initialize(name, &block)
      @result = OpenStruct.new({
        name: name
      })

      instance_eval(&block)
    end

    [:command, :content, :enable].each do |attr|
      define_method(attr) do |arg|
        @result.send("#{attr}=", arg)
      end

      private attr
    end
  end
end
{'fraction_non_alphanumeric': 0.09808342728297632, 'fraction_numerical': 0.002254791431792559, 'mean_word_length': 2.455252918287938, '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': '6171854', 'n_tokens_mistral': 285, 'n_tokens_neox': 272, 'n_words': 68}