Class: KyotoCabinet::VisitorProxy
- Inherits:
-
Object
- Object
- KyotoCabinet::VisitorProxy
- Includes:
- Java::Kyotocabinet::Visitor
- Defined in:
- lib/kyotocabinet.rb
Instance Method Summary collapse
-
#initialize(v, readonly = false) ⇒ VisitorProxy
constructor
A new instance of VisitorProxy.
- #visit_empty(key) ⇒ Object
- #visit_full(key, value) ⇒ Object
Constructor Details
#initialize(v, readonly = false) ⇒ VisitorProxy
Returns a new instance of VisitorProxy.
107 108 109 110 |
# File 'lib/kyotocabinet.rb', line 107 def initialize(v, readonly=false) @v = v @readonly = readonly end |
Instance Method Details
#visit_empty(key) ⇒ Object
112 113 114 115 |
# File 'lib/kyotocabinet.rb', line 112 def visit_empty(key) rv = @v.visit_empty(String.from_java_bytes(key)) rv && (! @readonly) ? rv.to_java_bytes : Visitor::NOP end |
#visit_full(key, value) ⇒ Object
117 118 119 120 121 |
# File 'lib/kyotocabinet.rb', line 117 def visit_full(key, value) rv = @v.visit_full(String.from_java_bytes(key), String.from_java_bytes(value)) rv && (! @readonly) ? rv.to_java_bytes : Visitor::NOP end |