Class: Rgltf::Extensions::KHRLightsPunctual::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/rgltf/extensions/khr_lights_punctual.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#lightsObject (readonly)

Returns the value of attribute lights.



7
8
9
# File 'lib/rgltf/extensions/khr_lights_punctual.rb', line 7

def lights
  @lights
end