Class: ActiveRecord::ConnectionAdapters::YugabyteDB::OID::Bit
- Inherits:
-
Type::Value
- Object
- Type::Value
- ActiveRecord::ConnectionAdapters::YugabyteDB::OID::Bit
- Defined in:
- lib/active_record/connection_adapters/yugabytedb/oid/bit.rb
Overview
:nodoc:
Direct Known Subclasses
Defined Under Namespace
Classes: Data
Instance Method Summary collapse
Instance Method Details
#cast_value(value) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/active_record/connection_adapters/yugabytedb/oid/bit.rb', line 12 def cast_value(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.to_s end end |
#serialize(value) ⇒ Object
25 26 27 |
# File 'lib/active_record/connection_adapters/yugabytedb/oid/bit.rb', line 25 def serialize(value) Data.new(super) if value end |
#type ⇒ Object
8 9 10 |
# File 'lib/active_record/connection_adapters/yugabytedb/oid/bit.rb', line 8 def type :bit end |