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

Add Faker::Games::Touhou #2197

Merged
merged 6 commits into from Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions doc/games/touhou.md
@@ -0,0 +1,18 @@
# Faker::Games::Touhou

```ruby
# Random Touhou game
Faker::Games::Touhou.game #=> "Mountain of Faith"

# Random Touhou character
Faker::Games::Touhou.character #=> "Sanae Kochiya"

# Random Touhou location
Faker::Games::Touhou.location #=> "Moriya Shrine"

# Random Touhou item
Faker::Games::Touhou.spell_card #=> 'Esoterica "Gray Thaumaturgy"'

# Random Touhou song
Faker::Games::Touhou.song #=> "Faith Is for the Transient People"
```
75 changes: 75 additions & 0 deletions lib/faker/games/touhou.rb
@@ -0,0 +1,75 @@
# frozen_string_literal: true

module Faker
class Games
class Touhou < Base
flexible :touhou
class << self
##
# Produces the name of a Touhou game.
#
# @return [String]
#
# @example
# Faker::Games::Touhou.game #=> "Mountain of Faith"
#
# @faker.version next
def game
fetch('games.touhou.games')
end

##
# Produces the name of a character from the Touhou games.
#
# @return [String]
#
# @example
# Faker::Games::Touhou.character #=> "Sanae Kochiya"
#
# @faker.version next
def character
fetch('games.touhou.characters')
end

##
# Produces the name of a location from the Touhou games.
#
# @return [String]
#
# @example
# Faker::Games::Touhou.location #=> "Moriya Shrine"
#
# @faker.version next
def location
fetch('games.touhou.locations')
end

##
# Produces the name of a spell card from the Touhou games.
#
# @return [String]
#
# @example
# Faker::Games::Touhou.spell_card #=> 'Esoterica "Gray Thaumaturgy"'
#
# @faker.version next
def spell_card
fetch('games.touhou.spell_cards')
end

##
# Produces the name of a song from the Touhou games.
#
# @return [String]
#
# @example
# Faker::Games::Touhou.song #=> "Faith Is for the Transient People"
#
# @faker.version next
def song
fetch('games.touhou.songs')
end
end
end
end
end