Skip to content

Instantly share code, notes, and snippets.

@mryoshio
Created July 13, 2013 17:37
Show Gist options
  • Save mryoshio/5991489 to your computer and use it in GitHub Desktop.
Save mryoshio/5991489 to your computer and use it in GitHub Desktop.
Ruby class to handle DynamoDB table using HashModel
class Book < AWS::Record::HashModel
set_shard_name :Book
string_attr :title
string_attr :author
string_attr :content
end
unless Book.dynamo_db_table.exists?
Book.create_table 1, 20
sleep 1 while Book.dynamo_db_table.status == :creating
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment