Class: VagrantCloud::Data::NilClass

Inherits:
BasicObject
Includes:
Singleton
Defined in:
lib/vagrant_cloud/data.rb

Overview

Custom nil class which is used for signifying a nil value that was not set by the user. This makes it easy to filter out values which are unset vs. those that are set to nil.

Instance Method Summary collapse

Instance Method Details

#!Object



23
# File 'lib/vagrant_cloud/data.rb', line 23

def !; true; end

#&(_) ⇒ Object



20
# File 'lib/vagrant_cloud/data.rb', line 20

def &(_); false; end

#==(v) ⇒ Object



12
# File 'lib/vagrant_cloud/data.rb', line 12

def ==(v); v.nil? || super(v); end

#===(v) ⇒ Object



13
# File 'lib/vagrant_cloud/data.rb', line 13

def ===(v); equal?(v); end

#^(_) ⇒ Object



22
# File 'lib/vagrant_cloud/data.rb', line 22

def ^(_); false; end

#equal?(v) ⇒ Boolean

Returns:

  • (Boolean)


14
# File 'lib/vagrant_cloud/data.rb', line 14

def equal?(v); v.nil? || super(v); end

#inspectObject



24
# File 'lib/vagrant_cloud/data.rb', line 24

def inspect; 'nil'; end

#nil?Boolean

Returns:

  • (Boolean)


11
# File 'lib/vagrant_cloud/data.rb', line 11

def nil?; true; end

#to_aObject



17
# File 'lib/vagrant_cloud/data.rb', line 17

def to_a; []; end

#to_fObject



16
# File 'lib/vagrant_cloud/data.rb', line 16

def to_f; 0.0; end

#to_hObject



18
# File 'lib/vagrant_cloud/data.rb', line 18

def to_h; {}; end

#to_iObject



15
# File 'lib/vagrant_cloud/data.rb', line 15

def to_i; 0; end

#to_sObject



19
# File 'lib/vagrant_cloud/data.rb', line 19

def to_s; ""; end

#|(_) ⇒ Object



21
# File 'lib/vagrant_cloud/data.rb', line 21

def |(_); false; end