Class: MusicSetTheory::ScaleChords

Inherits:
Object
  • Object
show all
Defined in:
lib/music_set_theory/chord_generator.rb,
lib/music_set_theory/chord_generator.rb

Overview

Represents all the chords associated with a scale. This is used to make a tabular representation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(full_name, key, full_notes, table_title) ⇒ ScaleChords

Returns a new instance of ScaleChords.



173
174
175
176
177
178
179
# File 'lib/music_set_theory/chord_generator.rb', line 173

def initialize( full_name, key, full_notes, table_title )
  self.full_name    = full_name
  self.key          = key
  self.full_notes   = full_notes
  self.table_title  = table_title
  self.rows         = []
end

Instance Attribute Details

#full_nameObject

Returns the value of attribute full_name.



172
173
174
# File 'lib/music_set_theory/chord_generator.rb', line 172

def full_name
  @full_name
end

#full_notesObject

Returns the value of attribute full_notes.



172
173
174
# File 'lib/music_set_theory/chord_generator.rb', line 172

def full_notes
  @full_notes
end

#keyObject

Returns the value of attribute key.



172
173
174
# File 'lib/music_set_theory/chord_generator.rb', line 172

def key
  @key
end

#rowsObject

Returns the value of attribute rows.



172
173
174
# File 'lib/music_set_theory/chord_generator.rb', line 172

def rows
  @rows
end

#table_titleObject

Returns the value of attribute table_title.



172
173
174
# File 'lib/music_set_theory/chord_generator.rb', line 172

def table_title
  @table_title
end

Instance Method Details

#to_aObject



181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/music_set_theory/chord_generator.rb', line 181

def to_a
  tmp = []
  tmp << [ self.full_name, self.key, self.full_notes, self.table_title, ]

  #
  self.rows.map{|r|
    # tmp << r.to_a
    # tmp += r.to_a
    tmp << r.to_a
  }

  ret = tmp
  ret
end