Class: Jcsv::RBStringGeneric

Inherits:
Filter
  • Object
show all
Defined in:
lib/filters.rb

Overview

Instance Attribute Summary

Attributes included from NextFilter

#last_filter, #next_filter

Instance Method Summary collapse

Methods included from NextFilter

#>>, #exec_next

Constructor Details

#initialize(function, *args, block: nil) ⇒ RBStringGeneric

Returns a new instance of RBStringGeneric.



264
265
266
267
268
269
# File 'lib/filters.rb', line 264

def initialize(function, *args, block: nil)
  @function = function
  @args = args
  @block = block
  super()
end

Instance Method Details

#execute(value, context) ⇒ Object



271
272
273
274
# File 'lib/filters.rb', line 271

def execute(value, context)
  value = value.send(@function, *(@args), &(@block))
  exec_next(value, context)
end