Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract constants in Faker::Music #1874

Merged
merged 1 commit into from
Dec 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions lib/faker/music/music.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
module Faker
class Music < Base
class << self
NOTE_LETTERS = %w[C D E F G A B].freeze
ACCIDENTAL_SIGNS = ['b', '#', ''].freeze
KEY_TYPES = ['', 'm'].freeze
CHORD_TYPES = ['', 'maj', '6', 'maj7', 'm', 'm7', '-7', '7', 'dom7', 'dim', 'dim7', 'm7b5'].freeze

##
# Produces the name of a key/note, using letter notation.
#
Expand Down Expand Up @@ -49,7 +54,7 @@ def instrument
#
# @faker.version 1.6.4
def keys
%w[C D E F G A B]
NOTE_LETTERS
end

##
Expand All @@ -59,7 +64,7 @@ def keys
#
# @faker.version 1.6.4
def key_variants
['b', '#', '']
ACCIDENTAL_SIGNS
end

##
Expand All @@ -72,7 +77,7 @@ def key_variants
#
# @faker.version 1.6.4
def key_types
['', 'm']
KEY_TYPES
end

##
Expand All @@ -82,7 +87,7 @@ def key_types
#
# @faker.version 1.6.4
def chord_types
['', 'maj', '6', 'maj7', 'm', 'm7', '-7', '7', 'dom7', 'dim', 'dim7', 'm7b5']
CHORD_TYPES
end

##
Expand Down