<commit_before>require 'utilities'

module Rubeetup
  # NOTE: This module expects to be mixed in to a class which implements
  # the instance method 'name'.
  module MeetupCatalog
    extend Utilities

    def is_in_catalog?
      catalog[name]
    end

    def required_options
      catalog[name][:options] || cry('options')
    end

    def request_path
      catalog[name][:path] || cry('path')
    end

    private

    def catalog
      @data ||= MeetupCatalog.requests
    end

    def cry(why)
      raise CatalogError, error_message(why)
    end

    def error_message(object)
      "Cannot find '#{object}' for the '#{name}' request."
    end

    # private module method

    def self.requests
      {
        get_events: { path: ->(options) { "/2/events?#{stringify(options)}" },
                      options: [:event_id, :group_domain, :group_id,
                                :group_urlname, :member_id, :rsvp, :venue_id] }
      }
    end
  end
end<commit_msg>removed useless code<commit_after>require 'utilities'

module Rubeetup
  # NOTE: This module expects to be mixed in to a class which implements
  # the instance method 'name'.
  module MeetupCatalog
    extend Utilities

    def is_in_catalog?
      catalog[name]
    end

    def required_options
      catalog[name][:options]
    end

    def request_path
      catalog[name][:path]
    end

    private

    def catalog
      @data ||= Rubeetup::MeetupCatalog.send(:requests)
    end

    def self.requests
      {
        get_events: { path: ->(options) { "/2/events?#{stringify(options)}" },
                      options: [:event_id, :group_domain, :group_id,
                                :group_urlname, :member_id, :rsvp, :venue_id] }
      }
    end

    private_class_method :requests
  end
end
{'fraction_non_alphanumeric': 0.09915966386554621, 'fraction_numerical': 0.0011204481792717086, 'mean_word_length': 2.3074074074074074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6161790', 'n_tokens_mistral': 553, 'n_tokens_neox': 537, 'n_words': 145}