Method: ReadXls::RecordHandler::Format#call

Defined in:
lib/read_xls/record_handler/format.rb

#callObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/read_xls/record_handler/format.rb', line 6

def call
  index, char_count, grbit = record_data
                               .byteslice(0, 5)
                               .unpack("v2C")

  char_byte_size = (grbit & F_HIGH_BYTE) == 0 ? 1 : 2

  string_length = char_count * char_byte_size
  format_string = record_data.byteslice(5, string_length)

  builder.add_format(index, format_string)
end