Class: Caf::Chunk::MagicCookie

Inherits:
Base
  • Object
show all
Defined in:
lib/caf/chunk/magic_cookie.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#chunk_size, #chunk_type

Instance Method Summary collapse

Methods inherited from Base

#check_type_and_size, implements, #initialize

Constructor Details

This class inherits a constructor from Caf::Chunk::Base

Instance Attribute Details

#positionObject (readonly)

, :data



11
12
13
# File 'lib/caf/chunk/magic_cookie.rb', line 11

def position
  @position
end

#sizeObject (readonly)

, :data



11
12
13
# File 'lib/caf/chunk/magic_cookie.rb', line 11

def size
  @size
end

Instance Method Details

#fields_sizeObject

Raises:



23
24
25
# File 'lib/caf/chunk/magic_cookie.rb', line 23

def fields_size
  raise(Caf::Error, "not implemented")
end

#read_data(file) ⇒ Object



27
28
29
30
31
32
# File 'lib/caf/chunk/magic_cookie.rb', line 27

def read_data(file)
  @size = chunk_size
  @position = file.pos
  #@data = file.read(chunk_size)
  super(file)
end

#to_sObject



13
14
15
16
17
# File 'lib/caf/chunk/magic_cookie.rb', line 13

def to_s
  "#{chunk_type} (magic cookie chunk)\n" +
    " -cookie size:        #{size}\n" +
    " -cookie position:    #{position}\n"
end

#validateObject



19
20
21
# File 'lib/caf/chunk/magic_cookie.rb', line 19

def validate
  true
end