Class: Blender3d::ArrayType
- Inherits:
-
Object
- Object
- Blender3d::ArrayType
- Defined in:
- lib/blender-3d/types/array_type.rb
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #dimensions ⇒ Object
-
#initialize(type, size) ⇒ ArrayType
constructor
A new instance of ArrayType.
- #inspect ⇒ Object
- #read(reader) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(type, size) ⇒ ArrayType
Returns a new instance of ArrayType.
5 6 7 |
# File 'lib/blender-3d/types/array_type.rb', line 5 def initialize(type, size) @type, @size = type, size end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
3 4 5 |
# File 'lib/blender-3d/types/array_type.rb', line 3 def size @size end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/blender-3d/types/array_type.rb', line 3 def type @type end |
Instance Method Details
#dimensions ⇒ Object
9 10 11 |
# File 'lib/blender-3d/types/array_type.rb', line 9 def dimensions @sizes.size end |
#inspect ⇒ Object
17 18 19 |
# File 'lib/blender-3d/types/array_type.rb', line 17 def inspect "#{@type.inspect}[#@size]" end |
#read(reader) ⇒ Object
21 22 23 |
# File 'lib/blender-3d/types/array_type.rb', line 21 def read(reader) @size.times.map { @type.read(reader) } end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/blender-3d/types/array_type.rb', line 13 def to_s "Array[#@size](#@type)" end |