Sha256: d67be3431cd472e14debe34ff974059b4f133bbfda7b2bb347c16526a25cc93b
Contents?: true
Size: 610 Bytes
Versions: 3
Compression:
Stored size: 610 Bytes
Contents
# # This file is part of the lazier gem. Copyright (C) 2013 and above Shogun <shogun@cowtech.it>. # Licensed under the MIT license, which can be found at https://choosealicense.com/licenses/mit. # module Lazier # Extension for the boolean values. module Boolean extend ::ActiveSupport::Concern # Converts the boolean to a integer. # # @return [Fixnum] `1` for `true`, `0` for `false`. def to_i is_a?(TrueClass) ? 1 : 0 end # Returns the boolean itself for use in form helpers. # # @return [Boolean] The boolean value. def value self end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
lazier-4.2.9 | lib/lazier/boolean.rb |
lazier-4.2.8 | lib/lazier/boolean.rb |
lazier-4.2.3 | lib/lazier/boolean.rb |