Class: ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bit::Data
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bit::Data
- Defined in:
- lib/active_record/connection_adapters/postgresql/oid/bit.rb
Instance Method Summary collapse
- #binary? ⇒ Boolean
- #hex? ⇒ Boolean
-
#initialize(value) ⇒ Data
constructor
A new instance of Data.
- #to_s ⇒ Object
Constructor Details
#initialize(value) ⇒ Data
Returns a new instance of Data.
28 29 30 |
# File 'lib/active_record/connection_adapters/postgresql/oid/bit.rb', line 28 def initialize(value) @value = value end |
Instance Method Details
#binary? ⇒ Boolean
36 37 38 |
# File 'lib/active_record/connection_adapters/postgresql/oid/bit.rb', line 36 def binary? /\A[01]*\Z/.match?(value) end |
#hex? ⇒ Boolean
40 41 42 |
# File 'lib/active_record/connection_adapters/postgresql/oid/bit.rb', line 40 def hex? /\A[0-9A-F]*\Z/i.match?(value) end |
#to_s ⇒ Object
32 33 34 |
# File 'lib/active_record/connection_adapters/postgresql/oid/bit.rb', line 32 def to_s value end |