Class: Blender3d::FileBlock
- Inherits:
-
Object
- Object
- Blender3d::FileBlock
- Defined in:
- lib/blender-3d/file_block.rb
Defined Under Namespace
Classes: Reader
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#count ⇒ Object
Returns the value of attribute count.
-
#data ⇒ Object
Returns the value of attribute data.
-
#pointer ⇒ Object
Returns the value of attribute pointer.
-
#size ⇒ Object
Returns the value of attribute size.
-
#type ⇒ Object
Returns the value of attribute type.
-
#type_index ⇒ Object
Returns the value of attribute type_index.
Instance Method Summary collapse
- #deserialize(reader) ⇒ Object
-
#initialize(reader = nil) ⇒ FileBlock
constructor
A new instance of FileBlock.
- #parse_data(model) ⇒ Object
Constructor Details
#initialize(reader = nil) ⇒ FileBlock
Returns a new instance of FileBlock.
5 6 7 |
# File 'lib/blender-3d/file_block.rb', line 5 def initialize(reader = nil) deserialize(reader) if reader end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/blender-3d/file_block.rb', line 3 def code @code end |
#count ⇒ Object
Returns the value of attribute count.
3 4 5 |
# File 'lib/blender-3d/file_block.rb', line 3 def count @count end |
#data ⇒ Object
Returns the value of attribute data.
3 4 5 |
# File 'lib/blender-3d/file_block.rb', line 3 def data @data end |
#pointer ⇒ Object
Returns the value of attribute pointer.
3 4 5 |
# File 'lib/blender-3d/file_block.rb', line 3 def pointer @pointer end |
#size ⇒ Object
Returns the value of attribute size.
3 4 5 |
# File 'lib/blender-3d/file_block.rb', line 3 def size @size end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/blender-3d/file_block.rb', line 3 def type @type end |
#type_index ⇒ Object
Returns the value of attribute type_index.
3 4 5 |
# File 'lib/blender-3d/file_block.rb', line 3 def type_index @type_index end |
Instance Method Details
#deserialize(reader) ⇒ Object
9 10 11 |
# File 'lib/blender-3d/file_block.rb', line 9 def deserialize(reader) Reader.new(reader, self).read end |
#parse_data(model) ⇒ Object
13 14 15 16 17 |
# File 'lib/blender-3d/file_block.rb', line 13 def parse_data(model) file = StringIO.new(self.data) reader = model.create_reader(file) self.data = self.count.times.map { self.type.read(reader) } end |