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

Class Method 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)


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

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.



43
44
45
# File 'lib/vedeu/boolean.rb', line 43

def value
  @value
end

Class Method Details

.coerce(value = nil) ⇒ 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:



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

def self.coerce(value = nil)
  new(value).coerce
end

Instance Method Details

#coerceBoolean

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
# File 'lib/vedeu/boolean.rb', line 23

def coerce
  value ? true : false
end

#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:



28
29
30
# File 'lib/vedeu/boolean.rb', line 28

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:



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

def true?
  return false if false?

  true
end