Class: Aws::Pager Private
- Inherits:
-
Object
- Object
- Aws::Pager
- Defined in:
- lib/aws-sdk-core/pager.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Classes: NullPager
Instance Attribute Summary collapse
- #limit_key ⇒ Symbol? readonly private
Instance Method Summary collapse
-
#initialize(options) ⇒ Pager
constructor
private
A new instance of Pager.
- #next_tokens(response) ⇒ Hash private
- #prev_tokens(response) ⇒ Object private
- #truncated?(response) ⇒ Boolean private
Constructor Details
#initialize(options) ⇒ Pager
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Pager.
10 11 12 13 14 |
# File 'lib/aws-sdk-core/pager.rb', line 10 def initialize() @tokens = .fetch(:tokens) @limit_key = .fetch(:limit_key, nil) @more_results = .fetch(:more_results, nil) end |
Instance Attribute Details
#limit_key ⇒ Symbol? (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/aws-sdk-core/pager.rb', line 17 def limit_key @limit_key end |
Instance Method Details
#next_tokens(response) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 24 25 26 |
# File 'lib/aws-sdk-core/pager.rb', line 21 def next_tokens(response) @tokens.each.with_object({}) do |(source, target), next_tokens| value = JMESPath.search(source, response.data) next_tokens[target.to_sym] = value unless empty_value?(value) end end |
#prev_tokens(response) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 32 33 34 |
# File 'lib/aws-sdk-core/pager.rb', line 29 def prev_tokens(response) @tokens.each.with_object({}) do |(_, target), tokens| value = JMESPath.search(target, response.context.params) tokens[target.to_sym] = value unless empty_value?(value) end end |
#truncated?(response) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 41 42 43 44 45 46 |
# File 'lib/aws-sdk-core/pager.rb', line 38 def truncated?(response) if @more_results JMESPath.search(@more_results, response.data) else next_t = next_tokens(response) prev_t = prev_tokens(response) !(next_t.empty? || next_t == prev_t) end end |