Module: Octo::Utils

Defined in:
lib/octocore-cassandra/utils.rb

Class Method Summary collapse

Class Method Details

.deserialize(data) ⇒ Object

Deserialize a data.

Parameters:

  • data (String)

    A string containing Marshal dump of the object



18
19
20
# File 'lib/octocore-cassandra/utils.rb', line 18

def deserialize(data)
  Marshal::load(data)
end

.serialize(record) ⇒ Object

Serialize one record before adding it to the cache. Creates a ruby byte

stream

Parameters:

  • record (Object)

    Any object to be serialized



12
13
14
# File 'lib/octocore-cassandra/utils.rb', line 12

def serialize(record)
  Marshal::dump(record).to_s
end