Class: ScaleDSL::ScaleContext

Inherits:
Object
  • Object
show all
Defined in:
lib/scale_dsl/scale_dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scale_label) ⇒ ScaleContext

Returns a new instance of ScaleContext.



11
12
13
# File 'lib/scale_dsl/scale_dsl.rb', line 11

def initialize(scale_label)
  @scale_hash = {:label => scale_label}
end

Instance Attribute Details

#scale_hashObject (readonly)

Returns the value of attribute scale_hash.



9
10
11
# File 'lib/scale_dsl/scale_dsl.rb', line 9

def scale_hash
  @scale_hash
end

Instance Method Details

#inst_string(string_num, &block) ⇒ Object



15
16
17
18
19
20
# File 'lib/scale_dsl/scale_dsl.rb', line 15

def inst_string(string_num, &block)
  str_ctx = StringContext.new
  str_ctx.instance_exec &block
  string_hash = {:frets => str_ctx.fret_array, :fingers => str_ctx.finger_array, :intervals => str_ctx.interval_array}
  @scale_hash[string_num] = string_hash
end