Class: Typedocs::TypeSpec::Nil

Inherits:
Typedocs::TypeSpec show all
Defined in:
lib/typedocs/type_spec.rb

Instance Method Summary collapse

Constructor Details

#initializeNil

Returns a new instance of Nil.



92
93
94
# File 'lib/typedocs/type_spec.rb', line 92

def initialize
  @value = nil
end

Instance Method Details

#error_message_for(obj) ⇒ Object



101
102
103
# File 'lib/typedocs/type_spec.rb', line 101

def error_message_for(obj)
  "#{obj} should == #{@value.inspect}"
end

#to_sourceObject



98
99
100
# File 'lib/typedocs/type_spec.rb', line 98

def to_source
  @value.inspect
end

#valid?(obj) ⇒ Boolean

Returns:

  • (Boolean)


95
96
97
# File 'lib/typedocs/type_spec.rb', line 95

def valid?(obj)
  obj == @value
end