Class: KyotoCabinet::BlockVisitor

Inherits:
Object
  • Object
show all
Defined in:
lib/kyotocabinet.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proc) ⇒ BlockVisitor

Returns a new instance of BlockVisitor.



134
135
136
# File 'lib/kyotocabinet.rb', line 134

def initialize(proc)
  @proc = proc
end

Class Method Details

.wrap(proc, ro = false) ⇒ Object



126
127
128
# File 'lib/kyotocabinet.rb', line 126

def self.wrap(proc, ro=false)
  VisitorProxy.new(self.new(proc), ro)
end

.wrap_nop(proc) ⇒ Object



130
131
132
# File 'lib/kyotocabinet.rb', line 130

def self.wrap_nop(proc)
  NOPVisitor.new(self.wrap(proc, true))
end

Instance Method Details

#visit_empty(key) ⇒ Object



138
139
140
# File 'lib/kyotocabinet.rb', line 138

def visit_empty(key)
  @proc.call(key)
end

#visit_full(key, value) ⇒ Object



142
143
144
# File 'lib/kyotocabinet.rb', line 142

def visit_full(key, value)
  @proc.call(key, value)
end