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.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(base) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#assign(val) ⇒ Object
Assigns the value of
val
to this data object. -
#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.
Class Method Details
.included(base) ⇒ Object
:nodoc:
8 9 10 |
# File 'lib/bindata/framework.rb', line 8 def self.included(base) #:nodoc: base.extend ClassMethods end |
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.
40 41 42 |
# File 'lib/bindata/framework.rb', line 40 def assign(val) raise NotImplementedError end |
#clear? ⇒ Boolean
Returns true if the object has not been changed since creation.
34 35 36 |
# File 'lib/bindata/framework.rb', line 34 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.
51 52 53 |
# File 'lib/bindata/framework.rb', line 51 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.
57 58 59 |
# File 'lib/bindata/framework.rb', line 57 def offset_of(child) #:nodoc: 0 end |
#snapshot ⇒ Object
Returns a snapshot of this data object.
45 46 47 |
# File 'lib/bindata/framework.rb', line 45 def snapshot raise NotImplementedError end |