Class: MastodonCommand::LangConverter

Inherits:
Converter
  • Object
show all
Defined in:
lib/mastodon_command/lang_converter.rb

Instance Attribute Summary

Attributes inherited from Converter

#pattern, #replaces

Instance Method Summary collapse

Methods inherited from Converter

#initialize, #match

Constructor Details

This class inherits a constructor from MastodonCommand::Converter

Instance Method Details

#convert(input) ⇒ Object



3
4
5
6
7
8
# File 'lib/mastodon_command/lang_converter.rb', line 3

def convert(input)
  @replaces.each do |replace|
    input = input.gsub(/#{replace[:pattern]}/, replace[:replace])
  end
  input
end