Class: Oj::Store
- Inherits:
-
PStore
- Object
- PStore
- Oj::Store
- Defined in:
- lib/oj/store.rb
Constant Summary collapse
- VERSION =
'0.0.5'
Instance Attribute Summary collapse
-
#obtions ⇒ Object
readonly
Returns the value of attribute obtions.
Instance Method Summary collapse
- #dump(obj) ⇒ Object
- #empty_marshal_checksum ⇒ Object
- #empty_marshal_data ⇒ Object
-
#initialize(file_name, options = {}) ⇒ Store
constructor
A new instance of Store.
- #load(content) ⇒ Object
- #marshal_dump_supports_canonical_option? ⇒ Boolean
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, = {}) super(file_name, .fetch(:thread_safe, false)) = end |
Instance Attribute Details
#obtions ⇒ Object (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, ) end |
#empty_marshal_checksum ⇒ Object
32 33 34 |
# File 'lib/oj/store.rb', line 32 def empty_marshal_checksum EMPTY_MARSHAL_CHECKSUM end |
#empty_marshal_data ⇒ Object
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, ) end |
#marshal_dump_supports_canonical_option? ⇒ Boolean
24 25 26 |
# File 'lib/oj/store.rb', line 24 def marshal_dump_supports_canonical_option? false end |