Class: ActiveRecord::Type::OracleEnhanced::Raw

Inherits:
ActiveModel::Type::String
  • Object
show all
Defined in:
lib/active_record/type/oracle_enhanced/raw.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#serialize(value) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/active_record/type/oracle_enhanced/raw.rb', line 13

def serialize(value)
  # Encode a string or byte array as string of hex codes
  if value.nil?
    super
  else
    value = value.unpack("C*")
    value.map { |x| "%02X" % x }.join
  end
end

#typeObject



9
10
11
# File 'lib/active_record/type/oracle_enhanced/raw.rb', line 9

def type
  :raw
end