<commit_before># frozen_string_literal: true

require 'rest_my_case/context/errors/status'

module RestMyCase
  module Context
    class Status < Base
      class StatusString < String

        def method_missing(method, *args, &block)
          last_char = method[-1]
          method_name = method[0...-1]

          if last_char == '!'
            replace(method_name)
          elsif last_char == '?'
            method_name == self
          else
            super
          end
        end

      end

      def self.error_class
        Errors::Status
      end

      def status
        @status ||= StatusString.new 'ok'
      end

      def status=(_)
        raise 'status is a reserved keyword which cannot be set'
      end
    end
  end
end<commit_msg>defining #respond_to_missing?<commit_after># frozen_string_literal: true

require 'rest_my_case/context/errors/status'

module RestMyCase
  module Context
    class Status < Base
      class StatusString < String

        def method_missing(method, *args, &block)
          last_char = method[-1]
          method_name = method[0...-1]

          if last_char == '!'
            replace(method_name)
          elsif last_char == '?'
            method_name == self
          else
            super
          end
        end

        def respond_to_missing?(method_name, include_private = false)
          last_char = method_name[-1]

          last_char == '!' || last_char == '?' || super
        end

      end

      def self.error_class
        Errors::Status
      end

      def status
        @status ||= StatusString.new 'ok'
      end

      def status=(_)
        raise 'status is a reserved keyword which cannot be set'
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08188153310104529, 'fraction_numerical': 0.0040650406504065045, 'mean_word_length': 1.748006379585327, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4021429', 'n_tokens_mistral': 496, 'n_tokens_neox': 480, 'n_words': 134}