Class: NilClass

Inherits:
Object
  • Object
show all
Defined in:
lib/laser/standard_library/nil_false_true.rb

Direct Known Subclasses

LaserMagic::LaserFakeNil

Instance Method Summary (collapse)

Instance Method Details

- (Object) &(other)

pure: true raises: false



4
5
6
# File 'lib/laser/standard_library/nil_false_true.rb', line 4

def &(other)
  false
end

- (Object) ^(other)

pure: true raises: false



9
10
11
# File 'lib/laser/standard_library/nil_false_true.rb', line 9

def ^(other)
  !!other
end

- (Object) inspect

pure: true raises: false



14
15
16
# File 'lib/laser/standard_library/nil_false_true.rb', line 14

def inspect
  'nil'
end

- (Boolean) nil?

pure: true raises: false



19
20
21
# File 'lib/laser/standard_library/nil_false_true.rb', line 19

def nil?
  true
end

- (Object) rationalize Also known as: to_r

pure: true raises: false



24
25
26
# File 'lib/laser/standard_library/nil_false_true.rb', line 24

def rationalize
  0.to_r
end

- (Object) to_a

pure: true raises: false



29
30
31
# File 'lib/laser/standard_library/nil_false_true.rb', line 29

def to_a
  []
end

- (Object) to_c

pure: true raises: false



34
35
36
# File 'lib/laser/standard_library/nil_false_true.rb', line 34

def to_c
  0.to_c
end

- (Object) to_f

pure: true raises: false



39
40
41
# File 'lib/laser/standard_library/nil_false_true.rb', line 39

def to_f
  0.0
end

- (Object) to_i

pure: true raises: false



44
45
46
# File 'lib/laser/standard_library/nil_false_true.rb', line 44

def to_i
  0
end

- (Object) to_s

pure: true raises: false



51
52
53
# File 'lib/laser/standard_library/nil_false_true.rb', line 51

def to_s
  ''
end

- (Object) |(other)

pure: true raises: false



57
58
59
# File 'lib/laser/standard_library/nil_false_true.rb', line 57

def |(other)
  !!other
end