Class: Burn::Fuel::Rom::Sound
- Defined in:
- lib/burn/fuel/rom/sound.rb
Instance Method Summary collapse
- #effect(&block) ⇒ Object
-
#initialize(resource_name, context) ⇒ Sound
constructor
A new instance of Sound.
Methods inherited from DslBase
Methods included from Debug
Constructor Details
#initialize(resource_name, context) ⇒ Sound
Returns a new instance of Sound.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/burn/fuel/rom/sound.rb', line 5 def initialize(resource_name, context) super(resource_name, context) if resource_name.nil? then raise Exception.new "Resource name for Sound class must be provided." else @resource_name = resource_name end @context.instance_exec resource_name, &lambda{|resource_name| @resources["#{resource_name}"] = Array.new } @se = SoundEffect.new end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Burn::Fuel::DslBase
Instance Method Details
#effect(&block) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/burn/fuel/rom/sound.rb', line 22 def effect(&block) @context.instance_exec(@resource_name,@se) do |resource_name,se| se.load(&block) @resources["#{resource_name}"] << se.generate end end |