Module: BinData::Base::AutoCallDelayedIO
- Defined in:
- lib/bindata/delayed_io.rb
Instance Method Summary collapse
- #initialize_shared_instance ⇒ Object
- #num_bytes ⇒ Object
- #read(io) ⇒ Object
- #write(io, *args) ⇒ Object
Instance Method Details
#initialize_shared_instance ⇒ Object
176 177 178 179 |
# File 'lib/bindata/delayed_io.rb', line 176 def initialize_shared_instance top_level_set(:delayed_ios, []) super end |
#num_bytes ⇒ Object
189 190 191 |
# File 'lib/bindata/delayed_io.rb', line 189 def num_bytes to_binary_s.size end |
#read(io) ⇒ Object
181 182 183 |
# File 'lib/bindata/delayed_io.rb', line 181 def read(io) super(io) { top_level_get(:delayed_ios).each { |obj| obj.read_now! } } end |
#write(io, *args) ⇒ Object
185 186 187 |
# File 'lib/bindata/delayed_io.rb', line 185 def write(io, *args) super(io) { top_level_get(:delayed_ios).each { |obj| obj.write_now! } } end |