Class: Restspec::Schema::Types::NullType

Inherits:
BasicType
  • Object
show all
Defined in:
lib/restspec/schema/types/null_type.rb

Instance Method Summary collapse

Methods inherited from BasicType

#initialize, #of, #to_s, #totally_valid?, #|

Constructor Details

This class inherits a constructor from Restspec::Schema::Types::BasicType

Instance Method Details

#example_for(attribute) ⇒ Object

Returns nil.

Parameters:

Returns:

  • nil



6
7
8
# File 'lib/restspec/schema/types/null_type.rb', line 6

def example_for(attribute)
  nil
end

#valid?(attribute, value) ⇒ true, false

Returns If the value is nil.

Parameters:

Returns:

  • (true, false)

    If the value is nil.



14
15
16
# File 'lib/restspec/schema/types/null_type.rb', line 14

def valid?(attribute, value)
  value.nil?
end