class Banzai::Filter

Filter transforms an input into desired output. The process of transformation should be implemented in the {#call} method.

Attributes

options[R]

Public Class Methods

call(input) click to toggle source

Delegates to {#call} by creating an instance with default options

@param [Object] input

# File lib/banzai/filter.rb, line 28
def self.call(input)
  new.call(input)
end
new(options = {}) click to toggle source

@param [Hash] options The parameters that method {#call} can utilize

to make processing customizable
# File lib/banzai/filter.rb, line 11
def initialize(options = {})
  @options = options
end

Public Instance Methods

call(input) click to toggle source

Subclass should redefine this method to transform input to desired output. Input and return value should be the same type to provide way of chaining filters

@param [Object] input @return [Object] the desired output

# File lib/banzai/filter.rb, line 21
def call(input)
  input
end