Help us understand the problem. What is going on with this article?

Gem 作りました。文章のNGワードチェックが簡単に可能です。

使い方

XXX.rb
require "message_judgment"
=> true
irb(main):002:0> message="Hello,I want your sex!"
=> "Hello,I want your sex!"
irb(main):003:0> targets=["sex","fuck"]
=> ["sex", "fuck"]
irb(main):004:0> MessageJudgment.message_judgment?(message,targets,false)
=> "Hello,I want your !"
XXX.rb
require "message_judgment"
=> true
irb(main):002:0> message="Hello,I want your sex!"
=> "Hello,I want your sex!"
irb(main):003:0> targets=["sex","fuck"]
=> ["sex", "fuck"]
irb(main):004:0> MessageJudgment.message_judgment?(message,targets,true)
=> "Hello,I want your ***!"

まず、チェックしたい文章を第一引数に、配列にNGワードを書き入れてそれを第二引数に渡してください第三引数は*に変換する場合は省略可能です。そうでなく空白にする場合はfalseを指定してください。
以上で、確認できます。

追記

updateしました.
主な変更点として:NGワードを空白にするのではなく*にも変換できるようにしました。

感想

誰でも作れます。現に高校生の僕でも出来ました。

お願い

簡単に使えるのでよろしくお願いします。
rubygemsorg
リポジトリ

NishidaRyu416
TransX株式会社のCEO兼エンジニアです。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした