Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TTFunk
- class File
- def initialize(file)
- ::File.open(file,"rb") do |fh|
- @directory = Table::Directory.new(fh)
- end
- end
- attr_reader :directory
- end
- class Table
- class Directory < Table
- def initialize(fh)
- @scaler_type, @table_count, @search_rage,
- @entry_selector, @range_shift, @tag, @check_sum,
- @offset, @length = fh.read(28).unpack("NnnnnNNNN")
- end
- end
- def method_missing(*args, &block)
- var = "@#{args.first}"
- instance_variables.include?(var) ? instance_variable_get(var) : super
- end
- end
- end
Add Comment
Please, Sign In to add comment