module Aws::PageableResponse::UnsafeEnumerableMethods
A handful of Enumerable methods, such as count
are not safe to call on a pageable response, as this would trigger n api calls simply to count the number of response pages, when likely what is wanted is to access count on the data. Same for to_h
. @api private
Public Instance Methods
Source
# File lib/aws-sdk-core/pageable_response.rb, line 149 def as_json(_options = {}) data.to_h(data, as_json: true) end
Source
# File lib/aws-sdk-core/pageable_response.rb, line 129 def count if data.respond_to?(:count) data.count else raise NoMethodError, "undefined method `count'" end end
Source
# File lib/aws-sdk-core/pageable_response.rb, line 137 def respond_to?(method_name, *args) if method_name == :count data.respond_to?(:count) else super end end
Calls superclass method
Source
# File lib/aws-sdk-core/pageable_response.rb, line 153 def to_json(options = {}) as_json.to_json(options) end