Class: Rgltf::Accessor::Sparse
- Inherits:
-
Properties::Base
- Object
- Properties::Base
- Rgltf::Accessor::Sparse
- Defined in:
- lib/rgltf/properties/accessor.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#indices ⇒ Object
readonly
Returns the value of attribute indices.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Attributes inherited from Properties::Base
#extensions, #extras, #index, #name, #owner_type, #source_json
Instance Method Summary collapse
-
#initialize(json, document:, accessor_index:) ⇒ Sparse
constructor
A new instance of Sparse.
- #nested_properties ⇒ Object
Methods inherited from Properties::Base
#extension, #parse_extensions!
Constructor Details
#initialize(json, document:, accessor_index:) ⇒ Sparse
Returns a new instance of Sparse.
96 97 98 99 100 101 102 103 |
# File 'lib/rgltf/properties/accessor.rb', line 96 def initialize(json, document:, accessor_index:) super(json, document:, owner_type: :accessor_sparse) @count = json.fetch('count') @indices = Indices.new(json.fetch('indices'), document:, accessor_index:) @values = Values.new(json.fetch('values'), document:, accessor_index:) rescue KeyError => e raise FormatError, "invalid sparse accessor #{accessor_index}: #{e.}" end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
94 95 96 |
# File 'lib/rgltf/properties/accessor.rb', line 94 def count @count end |
#indices ⇒ Object (readonly)
Returns the value of attribute indices.
94 95 96 |
# File 'lib/rgltf/properties/accessor.rb', line 94 def indices @indices end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
94 95 96 |
# File 'lib/rgltf/properties/accessor.rb', line 94 def values @values end |
Instance Method Details
#nested_properties ⇒ Object
105 106 107 |
# File 'lib/rgltf/properties/accessor.rb', line 105 def nested_properties [indices, values] end |