Class: Packable::FilterCapture

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

Overview

Use to capture the blocks given to read/write

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ FilterCapture

Returns a new instance of FilterCapture.



93
94
95
# File 'lib/packable/packers.rb', line 93

def initialize(options)
  self.options = options
end

Instance Attribute Details

#optionsObject

:nodoc:



92
93
94
# File 'lib/packable/packers.rb', line 92

def options
  @options
end

Instance Method Details

#read(&block) ⇒ Object



97
98
99
# File 'lib/packable/packers.rb', line 97

def read(&block)
  options[:read_packed] = block
end

#write(&block) ⇒ Object



101
102
103
# File 'lib/packable/packers.rb', line 101

def write(&block)
  options[:write_packed] = block.unbind
end