<commit_before>class Genomer::RulesDSL

  def initialize
    @types = Array.new
  end

  def scaffold_file(location=nil)
    return @scaffold if location.nil?
    @scaffold = location
  end

  def sequence_file(location=nil)
    return @sequence if location.nil?
    @sequence = location
  end

  def annotation_file(location=nil)
    return @annotation_file if location.nil?
    @annotation_file = location
  end

  def out_file_name(name=nil)
    return @out_file_name if name.nil?
    @out_file_name = name
  end

  def out_dir_name(name=nil)
    return @out_dir_name if name.nil?
    @out_dir_name = name
  end

  def output(*types)
    return @types if types.empty?
    @types.concat types<commit_msg>Refactor DSL methods using helper method<commit_after>class Genomer::RulesDSL

  def initialize
    @types = Array.new
  end

  private

  def self.attribute(name)
    define_method(name) do |*arg|
      var = "@#{name}"
      unless arg.first # Is an argument is passed to the method?
        value = instance_variable_get(var)
        return value if value
      end
      instance_variable_set(var,arg.first)
    end
  end

  attribute :scaffold_file
  attribute :sequence_file
  attribute :annotation_file

  attribute :out_file_name
  attribute :out_dir_name

  public

  def output(*types)
    return @types if types.empty?
    @types.concat types
{'fraction_non_alphanumeric': 0.07505518763796909, 'fraction_numerical': 0.0, 'mean_word_length': 3.2767295597484276, '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': '5252522', 'n_tokens_mistral': 445, 'n_tokens_neox': 427, 'n_words': 118}