Sha256: cac88647dd93ce160e784a4753578e78b790bb82d15f0cf2b36ca68b2cd65482
Contents?: true
Size: 901 Bytes
Versions: 56
Compression:
Stored size: 901 Bytes
Contents
module Aws # @api private module Stubbing class StubData def initialize(operation) @rules = operation.output @pager = operation[:pager] end def stub(data = {}) stub = EmptyStub.new(@rules).stub remove_paging_tokens(stub) apply_data(data, stub) stub end private def remove_paging_tokens(stub) if @pager @pager.instance_variable_get("@tokens").keys.each do |path| key = path.split(/\b/)[0] stub[key] = nil end if more_results = @pager.instance_variable_get('@more_results') stub[more_results] = false end end end def apply_data(data, stub) ParamValidator.new(@rules, validate_required:false).validate!(data) DataApplicator.new(@rules).apply_data(data, stub) end end end end
Version data entries
56 entries across 56 versions & 1 rubygems