Guest User

Untitled

a guest
May 25th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. class TTFunk
  2. class File
  3. def initialize(file)
  4. ::File.open(file,"rb") do |fh|
  5. @directory = Table::Directory.new(fh)
  6. end
  7. end
  8.  
  9. attr_reader :directory
  10. end
  11.  
  12. class Table
  13.  
  14. class Directory < Table
  15. def initialize(fh)
  16. @scaler_type, @table_count, @search_rage,
  17. @entry_selector, @range_shift, @tag, @check_sum,
  18. @offset, @length = fh.read(28).unpack("NnnnnNNNN")
  19. end
  20.  
  21. end
  22.  
  23. def method_missing(*args, &block)
  24. var = "@#{args.first}"
  25. instance_variables.include?(var) ? instance_variable_get(var) : super
  26. end
  27.  
  28. end
  29. end
Add Comment
Please, Sign In to add comment