class Aws::Templates::Utils::Contextualized::Filter::Copy

Add all options into the context

The filter performs deep copy of entire options hash with consecutive merge into the resulting context

Example

class Piece
  contextualize filter(:copy)
end

i = Piece.new()
opts = Options.new(a: { q: 1 }, b: 2, c: { d: { r: 5 }, e: 1 })
opts.filter(i.filter) # => { a: { q: 1 }, b: 2, c: { d: { r: 5 }, e: 1 } }

Constants

PRE_FILTER

Public Instance Methods

filter(opts, memo, _) click to toggle source
# File lib/aws/templates/utils/contextualized/filter/copy.rb, line 28
def filter(opts, memo, _)
  result = Utils.deep_dup(opts.to_hash)
  PRE_FILTER.each { |k| result.delete(k) }
  Utils.merge(memo, result)
end