Class: Oj::Store

Inherits:
PStore
  • Object
show all
Defined in:
lib/oj/store.rb

Constant Summary collapse

VERSION =
'0.0.5'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name, options = {}) ⇒ Store

Returns a new instance of Store.



11
12
13
14
# File 'lib/oj/store.rb', line 11

def initialize(file_name, options = {})
  super(file_name, options.fetch(:thread_safe, false))
  @options = options
end

Instance Attribute Details

#obtionsObject (readonly)

Returns the value of attribute obtions.



9
10
11
# File 'lib/oj/store.rb', line 9

def obtions
  @obtions
end

Instance Method Details

#dump(obj) ⇒ Object



16
17
18
# File 'lib/oj/store.rb', line 16

def dump(obj)
  Oj.dump(obj, @options)
end

#empty_marshal_checksumObject



32
33
34
# File 'lib/oj/store.rb', line 32

def empty_marshal_checksum
  EMPTY_MARSHAL_CHECKSUM
end

#empty_marshal_dataObject



28
29
30
# File 'lib/oj/store.rb', line 28

def empty_marshal_data
  EMPTY_MARSHAL_DATA
end

#load(content) ⇒ Object



20
21
22
# File 'lib/oj/store.rb', line 20

def load(content)
  content.size.zero? ? {} : Oj.object_load(content, @options)
end

#marshal_dump_supports_canonical_option?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/oj/store.rb', line 24

def marshal_dump_supports_canonical_option?
  false
end