<commit_before>require 'active_support/core_ext/string/strip'

module ApiCachedAttributes
  class Error < StandardError; end

  class ScopeNotSet < Error
    def initialize(attribute_name)
      @attribute_name = attribute_name
    end

    def message
      <<-MESSAGE.strip_heredoc

        Undefined scope for attribute `#{@attribute_name}`. The scope is a
        required part of an attribute in order to uniquely identify it. Use
        `scope=` to set the scope.
      MESSAGE
    end
  end

  class ApiReadOnlyMethod < Error
    def initialize(method_name)
      @method_name = method_name
    end

    def message
      <<-MESSAGE.strip_heredoc

        The `ApiCachedAttributes` gem creates read only methods which represent
        API values. `#{@method_name}` was defined using this gem and this error
        is raised to indicate that these attributes are read only, although you
        may override this behavior by defining a `#{@method_name}=` setter
        method on this class.
      MESSAGE
    end
  end

  class BaseClassNotFound < Error
    def initialize(which_klass)
      @which_klass = which_klass
    end

    def message
      <<-MESSAGE.strip_heredoc

        A ApiCachedAttributes::Base class descendant named `#{@which_klass}`
        could not be found. Descendant class names are generally suffixed with
        'Attributes' and looked up without the attributes symbol. Example: A
        base class named 'GithubUserAttributes' is looked up with :github_user.
      MESSAGE
    end
  end
end<commit_msg>actually show the error messages<commit_after>require 'active_support/core_ext/string/strip'

module ApiCachedAttributes
  class Error < StandardError; end

  class ScopeNotSet < Error
    def initialize(attribute_name)
      @attribute_name = attribute_name
      super(message)
    end

    def message
      <<-MESSAGE.strip_heredoc

        Undefined scope for attribute `#{@attribute_name}`. The scope is a
        required part of an attribute in order to uniquely identify it. Use
        `scope=` to set the scope.
      MESSAGE
    end
  end

  class ApiReadOnlyMethod < Error
    def initialize(method_name)
      @method_name = method_name
      super(message)
    end

    def message
      <<-MESSAGE.strip_heredoc

        The `ApiCachedAttributes` gem creates read only methods which represent
        API values. `#{@method_name}` was defined using this gem and this error
        is raised to indicate that these attributes are read only, although you
        may override this behavior by defining a `#{@method_name}=` setter
        method on this class.
      MESSAGE
    end
  end

  class BaseClassNotFound < Error
    def initialize(which_klass)
      @which_klass = which_klass
      super(message)
    end

    def message
      <<-MESSAGE.strip_heredoc

        A ApiCachedAttributes::Base class descendant named `#{@which_klass}`
        could not be found. Descendant class names are generally suffixed with
        'Attributes' and looked up without the attributes symbol. Example: A
        base class named 'GithubUserAttributes' is looked up with :github_user.
      MESSAGE
    end
  end
end
{'fraction_non_alphanumeric': 0.054958938723941884, 'fraction_numerical': 0.0, 'mean_word_length': 2.8064903846153846, 'pattern_counts': {'":': 0, '<': 23, '<?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': '6627965', 'n_tokens_mistral': 850, 'n_tokens_neox': 838, 'n_words': 322}