class Pyper::Pipes::DefaultValues

@param default_values [Hash] A hash of default values to set within the provided attrs if they are not already present.

Public Instance Methods

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

@param attrs [Hash] The attributes of the item @param status [Hash] The mutable status field @return [Hash] The item attributes with default values inserted

# File lib/pyper/pipes/default_values.rb, line 8
def pipe(attrs, status = {})
  default_values.each do |field, value|
    attrs[field] = value unless attrs[field]
  end
  attrs
end