Class: FFI::Chm::Struct::Topics

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/ffi-chm/struct/topics.rb

Defined Under Namespace

Classes: TopicsRecord

Instance Method Summary collapse

Instance Method Details

#each_recordObject



10
11
12
13
14
# File 'lib/ffi-chm/struct/topics.rb', line 10

def each_record
  (rawdata.size >> 4).times do |i|
    yield record(i)
  end
end

#record(index) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/ffi-chm/struct/topics.rb', line 16

def record(index)
  io = StringIO.new rawdata
  io.seek index << 4
  r = TopicsRecord.new.read io
  r.set_context @chm
  r
end

#recordsObject



6
7
8
# File 'lib/ffi-chm/struct/topics.rb', line 6

def records
  Com8ble::Enumerator.new self, :each_record
end

#set_context(chm) ⇒ Object

:nodoc:



24
25
26
# File 'lib/ffi-chm/struct/topics.rb', line 24

def set_context(chm)# :nodoc:
  @chm = chm
end