Module: Lazier::Boolean

Extended by:
ActiveSupport::Concern
Defined in:
lib/lazier/boolean.rb

Overview

Extension for the boolean values.

Instance Method Summary (collapse)

Instance Method Details

- (Fixnum) to_i

Converts the boolean to an integer.

Returns:

  • (Fixnum)

    1 for true, 0 for false.



14
15
16
# File 'lib/lazier/boolean.rb', line 14

def to_i
  is_a?(TrueClass) ? 1 : 0
end

- (Boolean) value

Returns the boolean itself for use in form helpers.

Returns:



21
22
23
# File 'lib/lazier/boolean.rb', line 21

def value
  self
end