Class: CLIntegracon::Subject::ReplacementPattern
- Inherits:
-
Struct
- Object
- Struct
- CLIntegracon::Subject::ReplacementPattern
- Defined in:
- lib/CLIntegracon/subject.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#replacement ⇒ Object
Returns the value of attribute replacement.
Instance Method Summary collapse
-
#replace(output) ⇒ Object
Applies the replacement pattern to the given output, returning a new string with the replacement applied.
Instance Attribute Details
#pattern ⇒ Object
Returns the value of attribute pattern
4 5 6 |
# File 'lib/CLIntegracon/subject.rb', line 4 def pattern @pattern end |
#replacement ⇒ Object
Returns the value of attribute replacement
4 5 6 |
# File 'lib/CLIntegracon/subject.rb', line 4 def replacement @replacement end |
Instance Method Details
#replace(output) ⇒ Object
Applies the replacement pattern to the given output, returning a new string with the replacement applied
7 8 9 |
# File 'lib/CLIntegracon/subject.rb', line 7 def replace(output) output.gsub(pattern, replacement) end |