Sha256: 968746a0e4c7cb63c72485f735fc67a66a2627b66331670527871b8187095c35

Contents?: true

Size: 327 Bytes

Versions: 37

Compression:

Stored size: 327 Bytes

Contents

# frozen_string_literal: true

module EacRailsBase0
  class BooleanValue
    def self.to_b(object)
      return false if object.blank?

      if object.is_a?(String)
        object = object.strip
        object.present? && object != '0' && object != 'false'
      else
        object ? true : false
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
eac_rails_base0-0.52.3 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.52.2 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.52.1 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.52.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.51.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.50.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.49.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.48.1 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.48.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.47.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.46.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.45.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.44.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.43.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.42.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.41.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.40.1 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.40.0 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.39.1 lib/eac_rails_base0/boolean_value.rb
eac_rails_base0-0.39.0 lib/eac_rails_base0/boolean_value.rb