Class: Rgltf::Extensions::KHRLightsPunctual::Collection
- Inherits:
-
Object
- Object
- Rgltf::Extensions::KHRLightsPunctual::Collection
- Defined in:
- lib/rgltf/extensions/khr_lights_punctual.rb
Instance Attribute Summary collapse
-
#lights ⇒ Object
readonly
Returns the value of attribute lights.
Instance Method Summary collapse
-
#initialize(json) ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize(json) ⇒ Collection
Returns a new instance of Collection.
9 10 11 |
# File 'lib/rgltf/extensions/khr_lights_punctual.rb', line 9 def initialize(json) @lights = json.fetch('lights', []).each_with_index.map { |light, index| Light.new(light, index:) }.freeze end |
Instance Attribute Details
#lights ⇒ Object (readonly)
Returns the value of attribute lights.
7 8 9 |
# File 'lib/rgltf/extensions/khr_lights_punctual.rb', line 7 def lights @lights end |