<commit_before>module Paymill
  module Operations
    module Find
      module ClassMethods
        def find(id)
          response = Paymill.request(:get, "#{self.name.split("::").last.downcase}s/#{id}", {})
          self.new(response["data"])
        end
      end

      def self.included(base)
        base.extend(ClassMethods)
      end
    end
  end
end<commit_msg>Add the possibility to return a collection of subscriptions when no id specified<commit_after>module Paymill
  module Operations
    module Find
      module ClassMethods
        def find(id = nil)
          if id.nil?
            response = Paymill.request(:get, "#{self.name.split("::").last.downcase}s/", {})
          else
            response = Paymill.request(:get, "#{self.name.split("::").last.downcase}s/#{id}", {})
          end
          self.new(response["data"])
        end
      end

      def self.included(base)
        base.extend(ClassMethods)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.12474012474012475, 'fraction_numerical': 0.0, 'mean_word_length': 2.1782178217821784, 'pattern_counts': {'":': 3, '<': 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': '5692752', 'n_tokens_mistral': 279, 'n_tokens_neox': 280, 'n_words': 65}