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
-
#to_i ⇒ Fixnum
Converts the boolean to an integer.
-
#value ⇒ Boolean
Returns the boolean itself for use in form helpers.
Instance Method Details
#to_i ⇒ Fixnum
Converts the boolean to an integer.
16 17 18 |
# File 'lib/cowtech-extensions/boolean.rb', line 16 def to_i (self == true) ? 1 : 0 end |
#value ⇒ Boolean
Returns the boolean itself for use in form helpers.
23 24 25 |
# File 'lib/cowtech-extensions/boolean.rb', line 23 def value self end |