Module: Cowtech::Extensions::Boolean

Extended by:
ActiveSupport::Concern
Defined in:
lib/cowtech-extensions/boolean.rb

Overview

Extension for the boolean values.

Instance Method Summary collapse

Instance Method Details

#to_iFixnum

Converts the boolean to an integer.

Returns:

  • (Fixnum)

    1 for true, 0 for false.



16
17
18
# File 'lib/cowtech-extensions/boolean.rb', line 16

def to_i
	(self == true) ? 1 : 0
end

#valueBoolean

Returns the boolean itself for use in form helpers.

Returns:



23
24
25
# File 'lib/cowtech-extensions/boolean.rb', line 23

def value
	self
end