Class: MastodonCommand::Converter

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

Direct Known Subclasses

LangConverter, RandomConverter

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#patternObject

Returns the value of attribute pattern.



3
4
5
# File 'lib/mastodon_command/converter.rb', line 3

def pattern
  @pattern
end

#replacesObject

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