Class: Faker::Music

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/music/opera.rb,
lib/faker/music/music.rb,
lib/faker/music/phish.rb,
lib/faker/music/rock_band.rb,
lib/faker/music/grateful_dead.rb,
lib/faker/music/umphreys_mcgee.rb

Overview

A generator of titles of operas by Verdi, Rossini, Donizetti and Bellini

Defined Under Namespace

Classes: GratefulDead, Opera, Phish, RockBand, UmphreysMcgee

Constant Summary

Constants inherited from Base

Base::Letters, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.albumObject


38
39
40
# File 'lib/faker/music/music.rb', line 38

def album
  fetch('music.albums')
end

.bandObject


34
35
36
# File 'lib/faker/music/music.rb', line 34

def band
  fetch('music.bands')
end

.chordObject


10
11
12
# File 'lib/faker/music/music.rb', line 10

def chord
  key + sample(chord_types)
end

.chord_typesObject


30
31
32
# File 'lib/faker/music/music.rb', line 30

def chord_types
  ['', 'maj', '6', 'maj7', 'm', 'm7', '-7', '7', 'dom7', 'dim', 'dim7', 'm7b5']
end

.genreObject


42
43
44
# File 'lib/faker/music/music.rb', line 42

def genre
  fetch('music.genres')
end

.instrumentObject


14
15
16
# File 'lib/faker/music/music.rb', line 14

def instrument
  fetch('music.instruments')
end

.keyObject


6
7
8
# File 'lib/faker/music/music.rb', line 6

def key
  sample(keys) + sample(key_variants)
end

.key_typesObject


26
27
28
# File 'lib/faker/music/music.rb', line 26

def key_types
  ['', 'm']
end

.key_variantsObject


22
23
24
# File 'lib/faker/music/music.rb', line 22

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

.keysObject


18
19
20
# File 'lib/faker/music/music.rb', line 18

def keys
  %w[C D E F G A B]
end