Class: Mitake::Boolean Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mitake/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.

The helper object to define boolean value

Since:

  • 0.1.0

Constant Summary collapse

TRUE_VALUES =

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.

Since:

  • 0.1.0

%w[Y 1 yes true].freeze

Class Method Summary collapse

Class Method Details

.parse(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.

Parse boolean value

Since:

  • 0.1.0



16
17
18
19
20
21
# File 'lib/mitake/boolean.rb', line 16

def parse(value)
  return true if value == true
  return true if TRUE_VALUES.include?(value)

  false
end