Class: Dynamoid::AdapterPlugin::AwsSdkV3::Scan
- Inherits:
-
Object
- Object
- Dynamoid::AdapterPlugin::AwsSdkV3::Scan
- Defined in:
- lib/dynamoid/adapter_plugin/aws_sdk_v3/scan.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(client, table, conditions = {}, options = {}) ⇒ Scan
constructor
A new instance of Scan.
Constructor Details
#initialize(client, table, conditions = {}, options = {}) ⇒ Scan
Returns a new instance of Scan.
14 15 16 17 18 19 |
# File 'lib/dynamoid/adapter_plugin/aws_sdk_v3/scan.rb', line 14 def initialize(client, table, conditions = {}, = {}) @client = client @table = table @conditions = conditions @options = end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
12 13 14 |
# File 'lib/dynamoid/adapter_plugin/aws_sdk_v3/scan.rb', line 12 def client @client end |
#conditions ⇒ Object (readonly)
Returns the value of attribute conditions.
12 13 14 |
# File 'lib/dynamoid/adapter_plugin/aws_sdk_v3/scan.rb', line 12 def conditions @conditions end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'lib/dynamoid/adapter_plugin/aws_sdk_v3/scan.rb', line 12 def @options end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
12 13 14 |
# File 'lib/dynamoid/adapter_plugin/aws_sdk_v3/scan.rb', line 12 def table @table end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/dynamoid/adapter_plugin/aws_sdk_v3/scan.rb', line 21 def call request = build_request Enumerator.new do |yielder| api_call = lambda do |req| client.scan(req).tap do |response| yielder << response end end middlewares = Middleware::Backoff.new( Middleware::StartKey.new( Middleware::Limit.new(api_call, record_limit: record_limit, scan_limit: scan_limit) ) ) catch :stop_pagination do loop do middlewares.call(request) end end end end |