Class: MastodonCommand::Converter
- Inherits:
-
Object
- Object
- MastodonCommand::Converter
- Defined in:
- lib/mastodon_command/converter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#replaces ⇒ Object
Returns the value of attribute replaces.
Instance Method Summary collapse
- #convert(input) ⇒ Object
-
#initialize(pattern, replaces) ⇒ Converter
constructor
A new instance of Converter.
- #match(input) ⇒ Object
Constructor Details
#initialize(pattern, replaces) ⇒ Converter
Returns a new instance of Converter.
5 6 7 8 |
# File 'lib/mastodon_command/converter.rb', line 5 def initialize(pattern, replaces) @pattern = pattern @replaces = replaces end |
Instance Attribute Details
#pattern ⇒ Object
Returns the value of attribute pattern.
3 4 5 |
# File 'lib/mastodon_command/converter.rb', line 3 def pattern @pattern end |
#replaces ⇒ Object
Returns the value of attribute replaces.
3 4 5 |
# File 'lib/mastodon_command/converter.rb', line 3 def replaces @replaces end |
Instance Method Details
#convert(input) ⇒ Object
14 15 16 |
# File 'lib/mastodon_command/converter.rb', line 14 def convert(input) input end |
#match(input) ⇒ Object
10 11 12 |
# File 'lib/mastodon_command/converter.rb', line 10 def match(input) input.match(@pattern) end |