Class: Literal::Types::FalsyType Private

Inherits:
Object
  • Object
show all
Includes:
Literal::Type
Defined in:
lib/literal/types/falsy_type.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

Instance =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

new.freeze

Instance Method Summary collapse

Constructor Details

#initializeFalsyType

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of FalsyType.



9
10
11
# File 'lib/literal/types/falsy_type.rb', line 9

def initialize
  freeze
end

Instance Method Details

#===(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



17
18
19
# File 'lib/literal/types/falsy_type.rb', line 17

def ===(value)
  !value
end

#>=(other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



21
22
23
24
25
26
27
28
# File 'lib/literal/types/falsy_type.rb', line 21

def >=(other)
  case other
  when Literal::Types::FalsyType, nil, false
    true
  else
    false
  end
end

#inspectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



13
14
15
# File 'lib/literal/types/falsy_type.rb', line 13

def inspect
  "_Falsy"
end