Method: Dynamini::TestClient#range_key_query

Defined in:
lib/dynamini/test_client.rb

#range_key_query(args, tokens) ⇒ Object



155
156
157
158
159
160
161
162
163
164
# File 'lib/dynamini/test_client.rb', line 155

def range_key_query(args, tokens)
  start_val, end_val = range_key_limits(tokens)
  hash_key = hash_key_value(args).is_a?(Integer) ? tokens[2].to_i : tokens[2]
  parent = get_table(args[:table_name])[hash_key]

  return OpenStruct.new(items: []) unless parent

  selected = apply_filter_options(parent, args, start_val, end_val)
  OpenStruct.new(items: selected)
end