Class: Jax::Generators::LightGenerator

Inherits:
NamedBase
  • Object
show all
Defined in:
lib/generators/jax/light/light_generator.rb

Instance Method Summary collapse

Methods included from SourceRoot

#source_root

Methods included from CoffeeGenerator

included

Instance Method Details

#create_light_sourceObject



17
18
19
20
# File 'lib/generators/jax/light/light_generator.rb', line 17

def create_light_source
  template "light_source.resource.erb",
    File.join('app/assets/jax/resources/light_sources', "#{file_name}.resource")
end

#light_typeObject



8
9
10
11
12
13
14
15
# File 'lib/generators/jax/light/light_generator.rb', line 8

def light_type
  case type
  when 'spot', 'directional', 'point'
    type.upcase + "_LIGHT"
  else
    raise "Invalid light type. Expected one of ['spot', 'directional', 'point']"
  end
end