class TSparser::AribStringDecoder::Definition::CodeCaller

Public Class Methods

new() click to toggle source
# File lib/arib_string_decoder.rb, line 92
def initialize
  @map_whole = Hash.new
  @map_part  = Hash.new{0}
end

Public Instance Methods

candidates(seq) click to toggle source
# File lib/arib_string_decoder.rb, line 105
def candidates(seq)
  return @map_part[seq]
end
pull(seq) click to toggle source
# File lib/arib_string_decoder.rb, line 109
def pull(seq)
  unless res = @map_whole[seq]
    raise "No call match with #{seq}."
  end
  return res
end
set(name, seq, group, target_region, call_type) click to toggle source
# File lib/arib_string_decoder.rb, line 97
def set(name, seq, group, target_region, call_type)
  seq = seq.map{|int| Binary.from_int(int)}
  @map_whole[seq] = [group, target_region, call_type]
  seq.length.times do |i|
    @map_part[seq[0..i]] += 1
  end
end