Class: CouchbaseOrm::Types::Encrypted

Inherits:
ActiveModel::Type::Value
  • Object
show all
Defined in:
lib/couchbase-orm/types/encrypted.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(alg: 'CB_MOBILE_CUSTOM') ⇒ Encrypted

Returns a new instance of Encrypted.



8
9
10
11
# File 'lib/couchbase-orm/types/encrypted.rb', line 8

def initialize(alg: 'CB_MOBILE_CUSTOM')
  @alg = alg
  super()
end

Instance Attribute Details

#algObject (readonly)

Returns the value of attribute alg.



6
7
8
# File 'lib/couchbase-orm/types/encrypted.rb', line 6

def alg
  @alg
end

Instance Method Details

#serialize(value) ⇒ Object



13
14
15
16
17
# File 'lib/couchbase-orm/types/encrypted.rb', line 13

def serialize(value)
  return nil if value.nil?

  value
end