class Gotaku::Header
Constants
- DEFAULT
- FORMAT
- LENGTH
Attributes
code[R]
file[R]
fill[R]
index[R]
pass[R]
size[R]
skip[R]
type[R]
Public Class Methods
new(&block)
click to toggle source
# File lib/gotaku/header.rb, line 18 def initialize(&block) instance_eval(&block) if block_given? end
parse(bulk, options = {})
click to toggle source
# File lib/gotaku/header.rb, line 7 def self.parse(bulk, options = {}) new do @data = bulk ? bulk.unpack(FORMAT) : QUESTION @type, @pass, @size, @skip, @file, @code, @fill = @data @type, @file, @code = [@type, @file, @code].map {|l| l.toutf8.strip} @index = options[:index] end end
Public Instance Methods
verify?()
click to toggle source
# File lib/gotaku/header.rb, line 22 def verify? @code == '5TAKUQDT' || @code == '5TAKUQDX' end