Class: TuneYard::BasePlayer
- Inherits:
-
SonicPi::Spider
- Object
- SonicPi::Spider
- TuneYard::BasePlayer
show all
- Includes:
- SonicPi::Mods::Sound, SonicPi::SpiderAPI
- Defined in:
- lib/tune_yard/player.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
38
39
40
41
42
43
44
|
# File 'lib/tune_yard/player.rb', line 38
def method_missing name, *args
if @_outer_binding.local_variable_defined? name
@_outer_binding.local_variable_get name
else
@_outer_binding.send name, *args
end
end
|
Instance Method Details
#run(&block) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/tune_yard/player.rb', line 22
def run &block
@_outer_binding = block.binding
code = " use_arg_checks true\n use_debug true\n \#{block.to_source strip_enclosure: true}\n CODE\n __spider_eval code, workspace: __FILE__\nend\n"
|
#stop ⇒ Object
34
35
36
|
# File 'lib/tune_yard/player.rb', line 34
def stop
__stop_jobs
end
|