class DynaModel::Response
Public Class Methods
new(response)
click to toggle source
# File lib/dyna_model/response.rb, line 4 def initialize(response) raise ArgumentError, "response should be an AWS::Core::Response" unless response.is_a?(AWS::Core::Response) @raw_response = response end
strip_attr_types(hash)
click to toggle source
# File lib/dyna_model/response.rb, line 27 def self.strip_attr_types(hash) attrs = {} hash.each_pair do |k,v| attrs[k] = v.values.first end attrs end
Public Instance Methods
count()
click to toggle source
def values_from_response_hash(options = {}) @raw_response.inject({}) do |h, (key, value_hash)| h.update(key => value_hash.to_a.last) end end
# File lib/dyna_model/response.rb, line 15 def count @raw_response[:count] end
last_evaluated_key()
click to toggle source
# File lib/dyna_model/response.rb, line 19 def last_evaluated_key @raw_response[:last_evaluated_key] end
more_results?()
click to toggle source
# File lib/dyna_model/response.rb, line 23 def more_results? @raw_response.has_key?(:last_evaluated_key) end