Class: MastodonCthulhu::Convert

Inherits:
Object
  • Object
show all
Defined in:
lib/mastodon_cthulhu/convert.rb

Direct Known Subclasses

Random

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pattern, replaces) ⇒ Convert

Returns a new instance of Convert.



6
7
8
9
# File 'lib/mastodon_cthulhu/convert.rb', line 6

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_cthulhu/convert.rb', line 3

def pattern
  @pattern
end

#replacesObject

Returns the value of attribute replaces.



4
5
6
# File 'lib/mastodon_cthulhu/convert.rb', line 4

def replaces
  @replaces
end

Instance Method Details

#convert(input) ⇒ Object



15
16
17
# File 'lib/mastodon_cthulhu/convert.rb', line 15

def convert(input)
  input
end

#match(input) ⇒ Object



11
12
13
# File 'lib/mastodon_cthulhu/convert.rb', line 11

def match(input)
  input.match(@pattern)
end