Class: Toy::Dynamo::Response
- Inherits:
-
Object
- Object
- Toy::Dynamo::Response
- Defined in:
- lib/toy/dynamo/response.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#count ⇒ Object
end.
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #last_evaluated_key ⇒ Object
- #more_results? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
5 6 7 8 |
# File 'lib/toy/dynamo/response.rb', line 5 def initialize(response) raise ArgumentError, "response should be an AWS::Core::Response" unless response.is_a?(AWS::Core::Response) @raw_response = response end |
Class Method Details
.strip_attr_types(hash) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/toy/dynamo/response.rb', line 28 def self.strip_attr_types(hash) attrs = {} hash.each_pair do |k,v| attrs[k] = v.values.first end attrs end |
Instance Method Details
#count ⇒ Object
end
16 17 18 |
# File 'lib/toy/dynamo/response.rb', line 16 def count @raw_response[:count] end |
#last_evaluated_key ⇒ Object
20 21 22 |
# File 'lib/toy/dynamo/response.rb', line 20 def last_evaluated_key @raw_response[:last_evaluated_key] end |
#more_results? ⇒ Boolean
24 25 26 |
# File 'lib/toy/dynamo/response.rb', line 24 def more_results? @raw_response.has_key?(:last_evaluated_key) end |