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
permalink #initialize(type, size) ⇒ ArrayType
Returns a new instance of ArrayType.
147 148 149 |
# File 'lib/blender-3d/types.rb', line 147 def initialize(type, size) @type, @size = type, size end |
Instance Attribute Details
permalink #size ⇒ Object (readonly)
Returns the value of attribute size.
145 146 147 |
# File 'lib/blender-3d/types.rb', line 145 def size @size end |
permalink #type ⇒ Object (readonly)
Returns the value of attribute type.
145 146 147 |
# File 'lib/blender-3d/types.rb', line 145 def type @type end |
Instance Method Details
permalink #dimensions ⇒ Object
[View source]
151 152 153 |
# File 'lib/blender-3d/types.rb', line 151 def dimensions @sizes.size end |
permalink #inspect ⇒ Object
[View source]
159 160 161 |
# File 'lib/blender-3d/types.rb', line 159 def inspect "#{@type.inspect}[#@size]" end |
permalink #read(reader) ⇒ Object
[View source]
163 164 165 |
# File 'lib/blender-3d/types.rb', line 163 def read(reader) @size.times.map { @type.read(reader) } end |
permalink #to_s ⇒ Object
[View source]
155 156 157 |
# File 'lib/blender-3d/types.rb', line 155 def to_s "Array[#@size](#@type)" end |