Class BinaryBlocker::FixedArrayEncoder
In: lib/blocker.rb
Parent: GroupEncoder
GroupEncoder ListOfEncoder Blocker FixedArrayEncoder CountedArrayEncoder Encoder SimpleEncoder BitFieldEncoder OneOfEncoder PackedNumberEncoder PackedDateEncoder PackedDateTimeEncoder FixedStringEncoder FixedUTF16StringEncoder BinaryBlocker Module: BinaryBlocker

Methods

[]   []=   deblock   internal_block   new  

Public Class methods

[Source]

     # 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

Public Instance methods

[Source]

     # 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

[Source]

     # 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

[Source]

     # 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

[Source]

     # File lib/blocker.rb, line 546
546:     def internal_block(val)
547:       val.inject("") { |r, o| r + o.block }
548:     end

[Validate]