<commit_before>module JSchema
  module Validator
    class MultipleOf < SimpleValidator
      private

      self.keywords = ['multipleOf']

      def validate_args(multiple_of)
        if number?(multiple_of) && multiple_of > 0
          true
        else
          invalid_schema('multipleOf', multiple_of)
        end
      end

      def post_initialize(multiple_of)
        @multiple_of = multiple_of
      end

      def validate_instance(instance)
        number = BigDecimal.new(instance.to_s)
        div_remainder = number % @multiple_of
        unless div_remainder == 0
          "#{instance} must be a multiple of #{@multiple_of}"
        end
      end

      def applicable_types
        [Fixnum, Bignum, Float, BigDecimal]
      end
    end
  end
end<commit_msg>Fix multiple-of validator for rubinius<commit_after>module JSchema
  module Validator
    class MultipleOf < SimpleValidator
      private

      self.keywords = ['multipleOf']

      def validate_args(multiple_of)
        if number?(multiple_of) && multiple_of > 0
          true
        else
          invalid_schema('multipleOf', multiple_of)
        end
      end

      def post_initialize(multiple_of)
        @multiple_of = BigDecimal.new(multiple_of.to_s)
      end

      def validate_instance(instance)
        number = BigDecimal.new(instance.to_s)
        div_remainder = number % @multiple_of
        unless div_remainder == 0
          "#{instance} must be a multiple of #{@multiple_of}"
        end
      end

      def applicable_types
        [Fixnum, Bignum, Float, BigDecimal]
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.069375, 'fraction_numerical': 0.0025, 'mean_word_length': 2.202, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1541395', 'n_tokens_mistral': 468, 'n_tokens_neox': 453, 'n_words': 115}