Class: Rgltf::Buffer
- Inherits:
-
Properties::Base
- Object
- Properties::Base
- Rgltf::Buffer
- Defined in:
- lib/rgltf/properties/buffer.rb
Instance Attribute Summary collapse
-
#byte_length ⇒ Object
readonly
Returns the value of attribute byte_length.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Attributes inherited from Properties::Base
#extensions, #extras, #index, #name, #owner_type, #source_json
Instance Method Summary collapse
- #bytes ⇒ Object
-
#initialize(json, document:, index:) ⇒ Buffer
constructor
A new instance of Buffer.
Methods inherited from Properties::Base
#extension, #nested_properties, #parse_extensions!
Constructor Details
#initialize(json, document:, index:) ⇒ Buffer
Returns a new instance of Buffer.
10 11 12 13 14 |
# File 'lib/rgltf/properties/buffer.rb', line 10 def initialize(json, document:, index:) super(json, document:, index:, owner_type: :buffer) @uri = json['uri'] @byte_length = json.fetch('byteLength') end |
Instance Attribute Details
#byte_length ⇒ Object (readonly)
Returns the value of attribute byte_length.
8 9 10 |
# File 'lib/rgltf/properties/buffer.rb', line 8 def byte_length @byte_length end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
8 9 10 |
# File 'lib/rgltf/properties/buffer.rb', line 8 def uri @uri end |
Instance Method Details
#bytes ⇒ Object
16 17 18 |
# File 'lib/rgltf/properties/buffer.rb', line 16 def bytes @document.buffer_resolver.resolve(self) end |