class TTFunk::Table::Cff::OneBasedIndex

Attributes

base_index[R]

Public Class Methods

new(*args) click to toggle source
# File lib/ttfunk/table/cff/one_based_index.rb, line 20
def initialize(*args)
  @base_index = Index.new(*args)
end

Public Instance Methods

[](idx) click to toggle source
# File lib/ttfunk/table/cff/one_based_index.rb, line 24
def [](idx)
  if idx.zero?
    raise IndexError,
      "index #{idx} was outside the bounds of the index"
  end

  base_index[idx - 1]
end