Class: OutroRails::Chord
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- OutroRails::Chord
- Defined in:
- app/models/outro_rails/chord.rb
Constant Summary collapse
- QUALITIES =
{ major: 0, minor: 1, diminished: 2, augmented: 3, suspended_2: 4, suspended_4: 5, power: 6 }.freeze
- EXTENSIONS =
%w[6 7 maj7 dim7 9 11 13].freeze
- ALTERATIONS =
%w[b5 #5 b9 #9 #11 b13].freeze
- ADDED_TONES =
%w[add2 add4 add6 add9 add11 add13].freeze
Instance Method Summary collapse
- #display_added_tones ⇒ Object
- #display_alterations ⇒ Object
- #display_extension ⇒ Object
- #display_intervals ⇒ Object
- #to_param ⇒ Object
Instance Method Details
#display_added_tones ⇒ Object
59 60 61 |
# File 'app/models/outro_rails/chord.rb', line 59 def display_added_tones Array(added_tones).any? ? added_tones.join(", ") : "-" end |
#display_alterations ⇒ Object
55 56 57 |
# File 'app/models/outro_rails/chord.rb', line 55 def display_alterations Array(alterations).any? ? alterations.join(", ") : "-" end |
#display_extension ⇒ Object
51 52 53 |
# File 'app/models/outro_rails/chord.rb', line 51 def display_extension extension.presence || "-" end |
#display_intervals ⇒ Object
63 64 65 |
# File 'app/models/outro_rails/chord.rb', line 63 def display_intervals Array(intervals).join(" - ") end |
#to_param ⇒ Object
47 48 49 |
# File 'app/models/outro_rails/chord.rb', line 47 def to_param slug end |