Socket
Book a DemoInstallSign in
Socket

imasgen

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imasgen

0.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Imasgen

imasgenはアイドルマスターシリーズのアイドルの名前をランダムに返すライブラリです。gimeiやfakerのように使えます。 ミリオンライブ!、SideM、シンデレラガールズのキャラクター名を収録しています。

使い方

ランダムに名前を取得する

# ミリオンライブ!のキャラクター名を取得する
name = Imasgen.millionlive.name
name.kanji #=> "百瀬 莉緒"
name.hiragana #=> "ももせ りお"
name.katakana #=> "モモセ リオ"
name.romaji #=> "Rio Momose"
name.last.kanji #=> "百瀬"
name.last.hiragana #=> "ももせ"
name.last.katakana #=> "モモセ"
name.last.romaji #=> "Momose"
name.first.kanji #=> "莉緒"
name.first.hiragana #=> "りお"
name.first.katakana #=> "リオ"
name.first.romaji #=> "Rio"

SideM、シンデレラガールズのキャラクター名を取得するには...

sidem = Imasgen.sidem.name
sidem.kanji #=> "桜庭 薫"
cg = Imasgen.cinderella.name
cg.kanji #=> "櫻井 桃華"

また、このような使い方もできます。

"My name is #{Imasgen.millionlive.name}" #=> "My name is 桜守 歌織"

名前と苗字をごちゃ混ぜにする

name = Imasgen.millionlive.hotchpotch
name.kanji #=> "四条 紬"

複数事務所混ぜてそこからランダムで取得する

複数の事務所の所属アイドルを全部ごちゃ混ぜにしてランダムに取得したいときは以下の方法で出来ます。

mixnuts = Imasgen.mixnuts(Imasgen::CINDERELLA, Imasgen::MILLIONLIVE, Imasgen::SIDEM)
# また、省略して以下のように書くこともできます。
mixnuts = Imasgen.mixnuts
# 生成したリストから名前を取得
name = mixnuts.name
name.kanji #=> "最上 静香"
# 名前と苗字をごちゃ混ぜにすることもできます
hotchpotch = mixnuts.hotchpotch
hotchpotch.kanji #=> "持田 梨沙"

デフォルト設定について

  • ジュリアやピエールなど苗字が分からないキャラクターは初期設定では出現しないようになっています。この挙動を変更するには Imasgen.millionlive.be_strict = false のようにbe_strictプロパティを変更します。

Installation

Add this line to your application's Gemfile:

gem 'imasgen'

And then execute:

$ bundle

Or install it yourself as:

$ gem install imasgen

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/tumugin/imasgen.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 17 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.