Class: Blender3d::ArrayType
- Inherits:
-
Object
- Object
- Blender3d::ArrayType
- Defined in:
- lib/blender-3d/types.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.
120 121 122 |
# File 'lib/blender-3d/types.rb', line 120 def initialize(type, size) @type, @size = type, size end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
118 119 120 |
# File 'lib/blender-3d/types.rb', line 118 def size @size end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
118 119 120 |
# File 'lib/blender-3d/types.rb', line 118 def type @type end |
Instance Method Details
#dimensions ⇒ Object
124 125 126 |
# File 'lib/blender-3d/types.rb', line 124 def dimensions @sizes.size end |
#inspect ⇒ Object
132 133 134 |
# File 'lib/blender-3d/types.rb', line 132 def inspect "#{@type.inspect}[#@size]" end |
#read(reader) ⇒ Object
136 137 138 |
# File 'lib/blender-3d/types.rb', line 136 def read(reader) @size.times.map { @type.read(reader) } end |
#to_s ⇒ Object
128 129 130 |
# File 'lib/blender-3d/types.rb', line 128 def to_s "Array[#@size](#@type)" end |