Class: Faker::Music

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/music.rb

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, with_locale

Class Method Details

.instrumentObject



8
9
10
# File 'lib/faker/music.rb', line 8

def instrument
  fetch('music.instruments')
end

.keyObject



4
5
6
# File 'lib/faker/music.rb', line 4

def key
  keys.sample + key_variants.sample
end

.key_variantsObject



16
17
18
# File 'lib/faker/music.rb', line 16

def key_variants
  ['b', '#', '']
end

.keysObject



12
13
14
# File 'lib/faker/music.rb', line 12

def keys
  ['C', 'D', 'E', 'F', 'G', 'A', 'B']
end