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.



120
121
122
# File 'lib/blender-3d/types.rb', line 120

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

Instance Attribute Details

#sizeObject (readonly)

Returns the value of attribute size.



118
119
120
# File 'lib/blender-3d/types.rb', line 118

def size
  @size
end

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

#dimensionsObject



124
125
126
# File 'lib/blender-3d/types.rb', line 124

def dimensions
  @sizes.size
end

#inspectObject



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_sObject



128
129
130
# File 'lib/blender-3d/types.rb', line 128

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