Sha256: 9cf39c404f887b0734970ae377bddf7dfba4c5dd6698b74d45f38c456978e239
Contents?: true
Size: 1008 Bytes
Versions: 1
Compression:
Stored size: 1008 Bytes
Contents
module AAMVA class Calculator def self.subfile(type:, data_elements:, data_element_separator:, segment_terminator:) joined_pairs = data_elements .map { |k, v| "#{k}#{v}" } .join(data_element_separator) "#{type}#{joined_pairs}#{segment_terminator}" end def self.subfiles(subfiles:, data_element_separator:, segment_terminator:) subfiles.map do |type, subfile| Calculator.subfile( type: type, data_elements: subfile.data_elements, data_element_separator: data_element_separator, segment_terminator: segment_terminator ) end.join("") end def self.subfile_offset "TODO" end def self.subfile_length(type:, data_elements:, data_element_separator:, segment_terminator:) subfile( type: type, data_elements: data_elements, data_element_separator: data_element_separator, segment_terminator: segment_terminator ).length end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
aamva-0.2.0 | lib/aamva/calculator.rb |