Class: Clef::Parser::DSL::GroupBuilder
- Inherits:
-
Object
- Object
- Clef::Parser::DSL::GroupBuilder
- Includes:
- BlockEvaluation
- Defined in:
- lib/clef/parser/dsl.rb
Instance Method Summary collapse
-
#initialize(group) ⇒ GroupBuilder
constructor
A new instance of GroupBuilder.
- #staff(id, name: nil, clef: :treble, &block) ⇒ Object
Constructor Details
#initialize(group) ⇒ GroupBuilder
Returns a new instance of GroupBuilder.
85 86 87 |
# File 'lib/clef/parser/dsl.rb', line 85 def initialize(group) @group = group end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Clef::Parser::DSL::BlockEvaluation
Instance Method Details
#staff(id, name: nil, clef: :treble, &block) ⇒ Object
92 93 94 95 96 97 |
# File 'lib/clef/parser/dsl.rb', line 92 def staff(id, name: nil, clef: :treble, &block) staff = Clef::Core::Staff.new(id, name: name, clef: Clef::Core::Clef.new(clef)) evaluate_block(StaffBuilder.new(staff), &block) @group.add_staff(staff) staff end |