Class: ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bit
- Inherits:
-
Type::Value
- Object
- Type::Value
- ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bit
- Defined in:
- lib/active_record/connection_adapters/postgresql/oid/bit.rb
Overview
:nodoc:
Direct Known Subclasses
Defined Under Namespace
Classes: Data
Instance Attribute Summary
Attributes inherited from Type::Value
Instance Method Summary collapse
Methods inherited from Type::Value
#==, #binary?, #changed?, #changed_in_place?, #initialize, #klass, #number?, #text?, #type_cast_for_schema, #type_cast_from_database, #type_cast_from_user
Constructor Details
This class inherits a constructor from ActiveRecord::Type::Value
Instance Method Details
#type ⇒ Object
6 7 8 |
# File 'lib/active_record/connection_adapters/postgresql/oid/bit.rb', line 6 def type :bit end |
#type_cast(value) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/active_record/connection_adapters/postgresql/oid/bit.rb', line 10 def type_cast(value) if ::String === value case value when /^0x/i value[2..-1].hex.to_s(2) # Hexadecimal notation else value # Bit-string notation end else value end end |