class TTFunk::Table::Cff::OneBasedIndex
CFF Index
with indexing starting at 1.
Attributes
Underlaying Index
. @return [TTFunk::Table::Cff::Index]
Public Class Methods
Source
# File lib/ttfunk/table/cff/one_based_index.rb, line 25 def initialize(*args) @base_index = Index.new(*args) end
@param args [Array] all params are passed to the base index. @see Index
Public Instance Methods
Source
# File lib/ttfunk/table/cff/one_based_index.rb, line 34 def [](idx) if idx.zero? raise IndexError, "index #{idx} was outside the bounds of the index" end base_index[idx - 1] end
Get item by index.
@param idx [Integer] @return [any] @raise [IndexError] when requested index is 0.