Sha256: 4065ee84625c38897d9688031b5a0482afd3dec897de4d705ea6377f0bc2329b

Contents?: true

Size: 472 Bytes

Versions: 20

Compression:

Stored size: 472 Bytes

Contents

module Shoulda
  module Matchers
    module ActiveModel
      module Qualifiers
        # @private
        module AllowNil
          def initialize(*args)
            super
            @expects_to_allow_nil = false
          end

          def allow_nil
            @expects_to_allow_nil = true
            self
          end

          protected

          def expects_to_allow_nil?
            @expects_to_allow_nil
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
shoulda-matchers-6.4.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-6.3.1 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-6.3.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-6.2.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-6.1.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-6.0.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-5.3.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-5.2.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-5.1.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-5.0.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-5.0.0.rc1 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-4.5.1 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-4.5.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-4.4.1 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-4.4.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-4.3.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-4.2.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-4.1.2 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-4.1.1 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb
shoulda-matchers-4.1.0 lib/shoulda/matchers/active_model/qualifiers/allow_nil.rb