Module: RongCloud::Services::SensitiveWord
- Included in:
- RongCloud::Service
- Defined in:
- lib/rong_cloud/services/sensitive_word.rb
Overview
Instance Method Summary collapse
- #add_sensitive_word(word, replace_word = nil) ⇒ Object (also: #add_wordfilter)
- #batch_delete_sensitive_word(words) ⇒ Object
- #delete_sensitive_word(word) ⇒ Object (also: #delete_wordfilter)
- #sensitive_word_list ⇒ Object (also: #wordfilter_list)
Instance Method Details
#add_sensitive_word(word, replace_word = nil) ⇒ Object Also known as: add_wordfilter
5 6 7 8 9 10 11 12 |
# File 'lib/rong_cloud/services/sensitive_word.rb', line 5 def add_sensitive_word(word, replace_word = nil) arguments = { word: word } if replace_word.is_a?(String) && replace_word.length > 0 arguments.merge!(replaceWord: replace_word) end request("/sensitiveword/add", arguments) end |
#batch_delete_sensitive_word(words) ⇒ Object
20 21 22 |
# File 'lib/rong_cloud/services/sensitive_word.rb', line 20 def batch_delete_sensitive_word(words) request("/sensitiveword/batch/delete", words: [*words]) end |
#delete_sensitive_word(word) ⇒ Object Also known as: delete_wordfilter
15 16 17 |
# File 'lib/rong_cloud/services/sensitive_word.rb', line 15 def delete_sensitive_word(word) request("/sensitiveword/delete", { word: word }) end |
#sensitive_word_list ⇒ Object Also known as: wordfilter_list
24 25 26 |
# File 'lib/rong_cloud/services/sensitive_word.rb', line 24 def sensitive_word_list request("/sensitiveword/list") end |