Sha256: a31e47b139ffebffd7abfa8a0d8d1ffb82ac5db4d3dfd0556ce3563d4f149c82
Contents?: true
Size: 578 Bytes
Versions: 8
Compression:
Stored size: 578 Bytes
Contents
# frozen_string_literal: true module Grape module Validations class SingleAttributeIterator < AttributesIterator private def yield_attributes(val, attrs) attrs.each do |attr_name| yield val, attr_name, empty?(val), skip?(val) end end # Primitives like Integers and Booleans don't respond to +empty?+. # It could be possible to use +blank?+ instead, but # # false.blank? # => true def empty?(val) val.respond_to?(:empty?) ? val.empty? : val.nil? end end end end
Version data entries
8 entries across 8 versions & 1 rubygems