Class: Jcsv::RBGsub
Overview
Instance Attribute Summary
Attributes included from NextFilter
Instance Method Summary collapse
- #execute(value, context) ⇒ Object
-
#initialize(*args, block: nil) ⇒ RBGsub
constructor
A new instance of RBGsub.
Methods included from NextFilter
Constructor Details
#initialize(*args, block: nil) ⇒ RBGsub
Returns a new instance of RBGsub.
245 246 247 248 249 |
# File 'lib/filters.rb', line 245 def initialize(*args, block: nil) @args = args @block = block super() end |
Instance Method Details
#execute(value, context) ⇒ Object
251 252 253 254 |
# File 'lib/filters.rb', line 251 def execute(value, context) value = (@block)? @block.call(value, *(@args)) : value.gsub(*(@args)) exec_next(value, context) end |