Module: BinData::Framework

Included in:
Base
Defined in:
lib/bindata/framework.rb

Overview

All methods provided by the framework are to be implemented or overridden by subclasses of BinData::Base.

Instance Method Summary collapse

Instance Method Details

#assign(val) ⇒ Object

Assigns the value of val to this data object. Note that val must always be deep copied to ensure no aliasing problems can occur.

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/bindata/framework.rb', line 27

def assign(val)
  raise NotImplementedError
end

#bit_aligned?Boolean

Is this object aligned on non-byte boundaries?

Returns:

  • (Boolean)


49
50
51
# File 'lib/bindata/framework.rb', line 49

def bit_aligned?
  false
end

#clear?Boolean

Returns true if the object has not been changed since creation.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/bindata/framework.rb', line 21

def clear?
  raise NotImplementedError
end

#debug_name_of(child) ⇒ Object

Returns the debug name of child. This only needs to be implemented by objects that contain child objects.



38
39
40
# File 'lib/bindata/framework.rb', line 38

def debug_name_of(child) # :nodoc:
  debug_name
end

#offset_of(child) ⇒ Object

Returns the offset of child. This only needs to be implemented by objects that contain child objects.



44
45
46
# File 'lib/bindata/framework.rb', line 44

def offset_of(child) # :nodoc:
  0
end

#snapshotObject

Returns a snapshot of this data object.

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/bindata/framework.rb', line 32

def snapshot
  raise NotImplementedError
end