Class: Ruby2Faust::Program
- Inherits:
-
Object
- Object
- Ruby2Faust::Program
- Defined in:
- lib/ruby2faust/dsl.rb
Overview
Program-level metadata for Faust declarations
Instance Attribute Summary collapse
-
#declarations ⇒ Object
readonly
Returns the value of attribute declarations.
-
#imports ⇒ Object
readonly
Returns the value of attribute imports.
-
#process ⇒ Object
readonly
Returns the value of attribute process.
Instance Method Summary collapse
- #declare(key, value) ⇒ Object
- #import(lib) ⇒ Object
-
#initialize(process = nil, &block) ⇒ Program
constructor
A new instance of Program.
Constructor Details
#initialize(process = nil, &block) ⇒ Program
Returns a new instance of Program.
1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 |
# File 'lib/ruby2faust/dsl.rb', line 1277 def initialize(process = nil, &block) @declarations = {} @imports = ["stdfaust.lib"] if block_given? extend DSL @process = instance_eval(&block) else @process = process end end |
Instance Attribute Details
#declarations ⇒ Object (readonly)
Returns the value of attribute declarations.
1275 1276 1277 |
# File 'lib/ruby2faust/dsl.rb', line 1275 def declarations @declarations end |
#imports ⇒ Object (readonly)
Returns the value of attribute imports.
1275 1276 1277 |
# File 'lib/ruby2faust/dsl.rb', line 1275 def imports @imports end |
#process ⇒ Object (readonly)
Returns the value of attribute process.
1275 1276 1277 |
# File 'lib/ruby2faust/dsl.rb', line 1275 def process @process end |
Instance Method Details
#declare(key, value) ⇒ Object
1288 1289 1290 1291 |
# File 'lib/ruby2faust/dsl.rb', line 1288 def declare(key, value) @declarations[key] = value self end |
#import(lib) ⇒ Object
1293 1294 1295 1296 |
# File 'lib/ruby2faust/dsl.rb', line 1293 def import(lib) @imports << lib unless @imports.include?(lib) self end |