Sha256: 75dce3d0d3d7a21801b5af544dfdd381236d3e8805a7d6b36ccb8e414bc13d21

Contents?: true

Size: 590 Bytes

Versions: 1

Compression:

Stored size: 590 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'aequitas/rule/value'

module Aequitas
  class Rule
    class Value
      class NotEqual < Value

        def valid_value?(value)
          value != expected
        rescue ArgumentError
          # TODO: figure out better solution for: can't compare String with Integer
          true
        end

        def violation_type(resource)
          :not_equal_to
        end

        def violation_data(resource)
          [ [ :not_expected, expected ] ]
        end

      end # class NotEqual
    end # class Value
  end # class Rule
end # module Aequitas

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aequitas-0.0.2 lib/aequitas/rule/value/not_equal.rb