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
-
#assign(val) ⇒ Object
Assigns the value of
val
to this data object. -
#bit_aligned? ⇒ Boolean
Is this object aligned on non-byte boundaries?.
-
#clear? ⇒ Boolean
Returns true if the object has not been changed since creation.
-
#debug_name_of(child) ⇒ Object
Returns the debug name of
child
. -
#offset_of(child) ⇒ Object
Returns the offset of
child
. -
#snapshot ⇒ Object
Returns a snapshot of this data object.
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.
29 30 31 |
# File 'lib/bindata/framework.rb', line 29 def assign(val) raise NotImplementedError end |
#bit_aligned? ⇒ Boolean
Is this object aligned on non-byte boundaries?
51 52 53 |
# File 'lib/bindata/framework.rb', line 51 def bit_aligned? false end |
#clear? ⇒ Boolean
Returns true if the object has not been changed since creation.
23 24 25 |
# File 'lib/bindata/framework.rb', line 23 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.
40 41 42 |
# File 'lib/bindata/framework.rb', line 40 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.
46 47 48 |
# File 'lib/bindata/framework.rb', line 46 def offset_of(child) #:nodoc: 0 end |
#snapshot ⇒ Object
Returns a snapshot of this data object.
34 35 36 |
# File 'lib/bindata/framework.rb', line 34 def snapshot raise NotImplementedError end |