Class: MastodonCthulhu::Convert
- Inherits:
-
Object
- Object
- MastodonCthulhu::Convert
- Defined in:
- lib/mastodon_cthulhu/convert.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) ⇒ Convert
constructor
A new instance of Convert.
- #match(input) ⇒ Object
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
#pattern ⇒ Object
Returns the value of attribute pattern.
3 4 5 |
# File 'lib/mastodon_cthulhu/convert.rb', line 3 def pattern @pattern end |
#replaces ⇒ Object
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 |