Sha256: e1fee39c528f9008fc2b495b94e802913393b12c2e9e2ad62c4233bd5af2a863

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

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

require 'aequitas/rule/value'

module Aequitas
  class Rule
    class Value
      class GreaterThanOrEqual < 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)
          :greater_than_or_equal_to
        end

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

      end # class GreaterThanOrEqual
    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/greater_than_or_equal.rb