Class: Faker::Music
Constant Summary
Constants inherited
from Base
Base::Letters, Base::Numbers, Base::ULetters
Class Method Summary
collapse
Methods inherited from Base
bothify, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand_in_range, regexify, translate, unique, with_locale
Class Method Details
.chord ⇒ Object
8
9
10
|
# File 'lib/faker/music.rb', line 8
def chord
key + chord_types.sample
end
|
.chord_types ⇒ Object
28
29
30
|
# File 'lib/faker/music.rb', line 28
def chord_types
['', 'maj', '6', 'maj7', 'm', 'm7', '-7', '7', 'dom7', 'dim', 'dim7', 'm7b5']
end
|
.instrument ⇒ Object
12
13
14
|
# File 'lib/faker/music.rb', line 12
def instrument
fetch('music.instruments')
end
|
.key ⇒ Object
4
5
6
|
# File 'lib/faker/music.rb', line 4
def key
keys.sample + key_variants.sample
end
|
.key_types ⇒ Object
24
25
26
|
# File 'lib/faker/music.rb', line 24
def key_types
['', 'm']
end
|
.key_variants ⇒ Object
20
21
22
|
# File 'lib/faker/music.rb', line 20
def key_variants
['b', '#', '']
end
|
.keys ⇒ Object
16
17
18
|
# File 'lib/faker/music.rb', line 16
def keys
['C', 'D', 'E', 'F', 'G', 'A', 'B']
end
|