module IceCube::Validations::Count
Public Instance Methods
Source
# File lib/ice_cube/validations/count.rb, line 8 def count(max) unless max.nil? || max.is_a?(Integer) raise ArgumentError, "Expecting Integer or nil value for count, got #{max.inspect}" end replace_validations_for(:count, max && [Validation.new(max, self)]) self end
Source
# File lib/ice_cube/validations/count.rb, line 4 def occurrence_count (arr = @validations[:count]) && (val = arr[0]) && val.count end
Value reader for limit