Class: ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Bit::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/connection_adapters/postgresql/oid/bit.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


36
37
38
# File 'lib/active_record/connection_adapters/postgresql/oid/bit.rb', line 36

def binary?
  /\A[01]*\Z/ === value
end

#hex?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/active_record/connection_adapters/postgresql/oid/bit.rb', line 40

def hex?
  /\A[0-9A-F]*\Z/i === value
end

#to_sObject



32
33
34
# File 'lib/active_record/connection_adapters/postgresql/oid/bit.rb', line 32

def to_s
  value
end