Class: Musicality::ScoreDSL
- Inherits:
-
Object
- Object
- Musicality::ScoreDSL
- Defined in:
- lib/musicality/composition/dsl/score_dsl.rb
Instance Attribute Summary collapse
-
#score ⇒ Object
readonly
Returns the value of attribute score.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ScoreDSL
constructor
A new instance of ScoreDSL.
- #tempo_score(start_meter, start_tempo, &block) ⇒ Object
Constructor Details
#initialize ⇒ ScoreDSL
Returns a new instance of ScoreDSL.
11 12 13 |
# File 'lib/musicality/composition/dsl/score_dsl.rb', line 11 def initialize @score = nil end |
Instance Attribute Details
#score ⇒ Object (readonly)
Returns the value of attribute score.
10 11 12 |
# File 'lib/musicality/composition/dsl/score_dsl.rb', line 10 def score @score end |
Class Method Details
.load(fname) ⇒ Object
4 5 6 7 8 |
# File 'lib/musicality/composition/dsl/score_dsl.rb', line 4 def self.load fname dsl = ScoreDSL.new dsl.instance_eval(File.read(fname), fname) dsl end |
Instance Method Details
#tempo_score(start_meter, start_tempo, &block) ⇒ Object
15 16 17 18 |
# File 'lib/musicality/composition/dsl/score_dsl.rb', line 15 def tempo_score start_meter, start_tempo, &block @score = Score::Tempo.new(start_meter,start_tempo) @score.instance_eval(&block) end |