method
cast
v5.0.0.1 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bit
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