<commit_before>simple_item :register_block, :block_model_definition do
  ral do
    generate_code :package_item do
      class_definition model_name do |c|
        c.base :rgen_ral_block
        c.body do |buffer|
          register_block.generate_code(:block_model_item, :top_down, buffer)
        end
      end
    end

    def model_name
      "#{register_block.name}_block_model"
    end
  end
end<commit_msg>コード生成をメソッド化<commit_after>simple_item :register_block, :block_model_definition do
  ral do
    generate_code :package_item do
      class_definition model_name do |c|
        c.base :rgen_ral_block
        c.body { |code| body_code(code) }
      end
    end

    def model_name
      "#{register_block.name}_block_model"
    end

    def body_code(code)
      register_block.generate_code(:block_model_item, :top_down, code)
    end
  end
end
{'fraction_non_alphanumeric': 0.0702576112412178, 'fraction_numerical': 0.0, 'mean_word_length': 2.9953271028037385, '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': '5104899', 'n_tokens_mistral': 292, 'n_tokens_neox': 288, 'n_words': 61}