Class: Vedeu::Boolean Private

Inherits:
Object
  • Object
show all
Defined in:
lib/vedeu/boolean.rb

Overview

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.

Represent a boolean object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value = nil) ⇒ Vedeu::Boolean

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.

Parameters:

  • value (void) (defaults to: nil)


13
14
15
# File 'lib/vedeu/boolean.rb', line 13

def initialize(value = nil)
  @value = value
end

Instance Attribute Details

#valuevoid (readonly, private)

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.

This method returns an undefined value.



33
34
35
# File 'lib/vedeu/boolean.rb', line 33

def value
  @value
end

Instance Method Details

#false?Boolean

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:



18
19
20
# File 'lib/vedeu/boolean.rb', line 18

def false?
  value.nil? || value == false
end

#true?Boolean

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:



23
24
25
26
27
# File 'lib/vedeu/boolean.rb', line 23

def true?
  return false if false?

  true
end