class TTFunk::Table
Attributes
file[R]
length[R]
offset[R]
Public Class Methods
new(file)
click to toggle source
# File lib/ttfunk/table.rb, line 13 def initialize(file) @file = file @offset = nil @length = nil info = file.directory_info(tag) if info @offset = info[:offset] @length = info[:length] parse_from(@offset) { parse! } end end
Public Instance Methods
exists?()
click to toggle source
# File lib/ttfunk/table.rb, line 28 def exists? !@offset.nil? end
raw()
click to toggle source
# File lib/ttfunk/table.rb, line 32 def raw if exists? parse_from(offset) { io.read(length) } end end
tag()
click to toggle source
# File lib/ttfunk/table.rb, line 38 def tag self.class.name.split(/::/).last.downcase end
Private Instance Methods
parse!()
click to toggle source
# File lib/ttfunk/table.rb, line 44 def parse! # do nothing, by default end