Class | BinaryBlocker::FixedArrayEncoder |
In: |
lib/blocker.rb
|
Parent: | GroupEncoder |
# File lib/blocker.rb, line 538 538: def initialize(count, classes, *opts) 539: initialize_options(*opts) 540: @count = count 541: @classes = classes 542: @value = Array.new(count) { OneOfEncoder.new(classes, *opts) } 543: initialize_data(*opts) 544: end
# File lib/blocker.rb, line 560 560: def [](offset) 561: raise RangeError.new("Access (#{offset}) out of range (#{@count})") unless (0...@count) === offset 562: @value[offset] 563: end
# File lib/blocker.rb, line 565 565: def []=(offset,val) 566: raise RangeError.new("Access (#{offset}) out of range (#{@count})") unless (0...@count) === offset 567: @value[offset] = val 568: end
# File lib/blocker.rb, line 550 550: def deblock(io) 551: result = [] 552: with_guarded_io_pos(io) do 553: @count.times do 554: result << OneOfEncoder.new(@classes, io, @opts) 555: end 556: end 557: @value = result 558: end