<commit_before># frozen_string_literal: true

class ChannelsQuery
  # @param [Channel::ActiveRecord_Relation] collection
  # @param [Boolean] is_vod
  #
  # @return [Channel::ActiveRecord_Relation]
  def initialize(collection, is_vod:)
    @collection = collection
    @is_vod = is_vod
  end

  def call
    @collection = filter_by_is_vod if @is_vod
    @collection
  end

  private

  def filter_by_is_vod
    @collection.where(vod: @is_vod)
  end
end<commit_msg>The is_vod option may be nil<commit_after># frozen_string_literal: true

class ChannelsQuery
  # @param [Channel::ActiveRecord_Relation] collection
  # @param [Boolean, nil] is_vod
  #
  # @return [Channel::ActiveRecord_Relation]
  def initialize(collection, is_vod: nil)
    @collection = collection
    @is_vod = is_vod
  end

  def call
    @collection = filter_by_is_vod unless is_vod.nil?
    @collection
  end

  private

  attr_reader :is_vod

  def filter_by_is_vod
    return @collection if is_vod.nil?

    @collection.where(vod: is_vod)
  end
end
{'fraction_non_alphanumeric': 0.0832517140058766, 'fraction_numerical': 0.0, 'mean_word_length': 4.0594059405940595, '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': '4527133', 'n_tokens_mistral': 353, 'n_tokens_neox': 364, 'n_words': 84}