Class: Cript::EHash
- Inherits:
-
Object
- Object
- Cript::EHash
- Defined in:
- lib/cript/ehash.rb
Overview
A hash backed by a Cript::Store object. All methods sent to an instance of this object are wrapped in a transaction and executed immediately.
Constant Summary collapse
- METHODS =
Hash.new.methods - Object.new.methods
- KEY =
:data
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file, opts = {}) ⇒ EHash
constructor
A new instance of EHash.
- #inspect ⇒ Object
- #method_missing(sym, *args, &block) ⇒ Object
- #respond_to_missing?(sym, include_private = false) ⇒ Boolean
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Class Method Details
.insecure(file, opts = {}) ⇒ Object
22 23 24 |
# File 'lib/cript/ehash.rb', line 22 def self.insecure(file, opts = {}) new(file, opts.merge({ private_key_content: INSECURE_PRIVATE_KEY })) end |
Instance Method Details
#inspect ⇒ Object
26 27 28 |
# File 'lib/cript/ehash.rb', line 26 def inspect "#<#{self.class.name} path='#{@store.path}'>" end |
#respond_to_missing?(sym, include_private = false) ⇒ Boolean
38 39 40 |
# File 'lib/cript/ehash.rb', line 38 def respond_to_missing?(sym, include_private = false) METHODS.include?(sym) || super end |