-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdataaccess.rb
More file actions
45 lines (39 loc) · 1.07 KB
/
dataaccess.rb
File metadata and controls
45 lines (39 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require 'aws-sdk-core/dynamodb'
class Dataaccess
attr_reader :restaurantName
def initialize(restaurantName)
restaurantName = restaurantName
end
# dynamo_db = Aws::DynamoDB.new();
#dynamo_db
# dynamo_db = Aws::DynamoDB.new(
# :access_key_id => '',
# :secret_access_key => '');
# # DB = DynamoDB.new
# TABLES = {}
#
# {
# "restaurants" => {
# hash_key: {timeline_id: :string},
# range_key: {created_at: :number}
# },
# "users" => {
# hash_key: {id: :string}
# }
# }.each_pair do |table_name, schema|
# begin
# TABLES[table_name] = DB.tables[table_name].load_schema
# rescue ResourceNotFoundException
# table = DB.tables.create(table_name, 10, 5, schema)
# print "Creating table #{table_name}..."
# sleep 1 while table.status == :creating
# print "done!\n"
# TABLES[table_name] = table.load_schema
# end
# end
end
get '/dataaccess' do
# @restaurant = params[:restaurant]
dataaccess = Dataaccess.new(params[:restaurant]);
# "Hello World"
end