Sha256: ad64d3b29197ad5455e1205f55128515b9673977d2bf3a51f6c13e5200f51ae0
Contents?: true
Size: 608 Bytes
Versions: 21
Compression:
Stored size: 608 Bytes
Contents
# frozen_string_literal: true module Telnyx module APIOperations # Intercepts request params passed to api operation methods and wraps them in a single param. # Usage: # class << self # prepend Telnyx::ParamWrapper # wrap :list, 'filter' # end module ParamWrapper protected def wrap(method_name, wrapper) define_singleton_method(method_name) do |filters = {}, opts = {}| return super(filters, opts) if filters.keys == [wrapper] filters = { wrapper => filters } super filters, opts end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems