Class: Rulix::Mutators::Replace
- Inherits:
-
Object
- Object
- Rulix::Mutators::Replace
- Defined in:
- lib/rulix/mutators/replace.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
Instance Method Summary collapse
- #call(string) ⇒ Object
-
#initialize(args) ⇒ Replace
constructor
A new instance of Replace.
- #to_proc ⇒ Object
Constructor Details
#initialize(args) ⇒ Replace
Returns a new instance of Replace.
6 7 8 |
# File 'lib/rulix/mutators/replace.rb', line 6 def initialize args self.args = args end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
4 5 6 |
# File 'lib/rulix/mutators/replace.rb', line 4 def args @args end |
Instance Method Details
#call(string) ⇒ Object
14 15 16 17 18 |
# File 'lib/rulix/mutators/replace.rb', line 14 def call string raise ArgumentError, "argument is not a string" unless string.is_a? String string.gsub *args end |
#to_proc ⇒ Object
10 11 12 |
# File 'lib/rulix/mutators/replace.rb', line 10 def to_proc method(:call) end |