Class: Blender3d::ArrayType

Inherits:
Object
  • Object
show all
Defined in:
lib/blender-3d/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, size) ⇒ ArrayType

Returns a new instance of ArrayType.

[View source]

147
148
149
# File 'lib/blender-3d/types.rb', line 147

def initialize(type, size)
  @type, @size = type, size
end

Instance Attribute Details

#sizeObject (readonly)

Returns the value of attribute size.


145
146
147
# File 'lib/blender-3d/types.rb', line 145

def size
  @size
end

#typeObject (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

#dimensionsObject

[View source]

151
152
153
# File 'lib/blender-3d/types.rb', line 151

def dimensions
  @sizes.size
end

#inspectObject

[View source]

159
160
161
# File 'lib/blender-3d/types.rb', line 159

def inspect
  "#{@type.inspect}[#@size]"
end

#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

#to_sObject

[View source]

155
156
157
# File 'lib/blender-3d/types.rb', line 155

def to_s
  "Array[#@size](#@type)"
end