class Pyper::Pipes::RemoveFields

A generic pipe to remove fields from a pipeline

Attributes

fields_to_remove[R]

Public Class Methods

new(fields_to_remove) click to toggle source

@param fields_to_remove [Array] fields to be removed from pipe

# File lib/pyper/pipes/remove_fields.rb, line 8
def initialize(fields_to_remove)
  @fields_to_remove = Array.wrap(fields_to_remove)
end

Public Instance Methods

pipe(attributes, status = {}) click to toggle source

@param attributes [Hash] The attributes from which to remove the specified fields @param status [Hash] The mutable status field @return [Hash] attributes with the specified fields removed

# File lib/pyper/pipes/remove_fields.rb, line 15
def pipe(attributes, status = {})
  attributes = attributes.dup
  fields_to_remove.each { |field| attributes.delete(field) }

  attributes
end