method

cast

rails latest stable - Class: ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bit

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v5.0.0.1) is shown here.

cast(value)
public

No documentation available.

# File activerecord/lib/active_record/connection_adapters/postgresql/oid/bit.rb, line 10
          def cast(value)
            if ::String === value
              case value
              when /^0x/
                value[2..-1].hex.to_s(2) # Hexadecimal notation
              else
                value                    # Bit-string notation
              end
            else
              value
            end
          end