lib/aequitas/rule/length/range.rb in aequitas-0.0.1 vs lib/aequitas/rule/length/range.rb in aequitas-0.0.2
- old
+ new
@@ -2,14 +2,14 @@
require 'aequitas/rule/length'
module Aequitas
class Rule
- module Length
- class Range < Rule
+ class Length
+ class Range < Length
- include Length
+ equalize_on *superclass.superclass.equalizer.keys + [:range]
attr_reader :range
def initialize(attribute_name, options)
super
@@ -23,12 +23,10 @@
def violation_data(resource)
[ [ :min, range.begin ], [ :max, range.end ] ]
end
- private
-
# Validate the value length is within expected range
#
# @param [Integer] length
# the value length
#
@@ -39,8 +37,8 @@
def valid_length?(length)
range.include?(length)
end
end # class Range
- end # module Length
+ end # class Length
end # class Rule
end # module Aequitas