Class: ScaleGenerator::Scale

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

Instance Method Summary collapse

Constructor Details

#initialize(scale_hash, tuning = nil) ⇒ Scale

Returns a new instance of Scale.



6
7
8
# File 'lib/scale_generator/scale.rb', line 6

def initialize(scale_hash, tuning = nil)
  @scale_hash = scale_hash
end

Instance Method Details

#nameObject



16
17
18
# File 'lib/scale_generator/scale.rb', line 16

def name
  ScaleGenerator::Dictionary.name_for(frets)
end

#to_png(show_intervals = false, options = {}) ⇒ Object



10
11
12
13
14
# File 'lib/scale_generator/scale.rb', line 10

def to_png(show_intervals = false, options = {})
  tuning = (options[:tuning].nil?) ? ScaleGenerator::Dictionary::GUITAR_TUNINGS[:standard] : options[:tuning]

  ScaleGenerator::PNGFormatter.new(@scale_hash, tuning).print(@scale_hash, show_intervals)
end