Method: Stax::Cmd::DynamoDB#put

Defined in:
lib/stax/mixin/dynamodb.rb

#put(id) ⇒ Object



104
105
106
107
108
109
110
111
112
113
114
# File 'lib/stax/mixin/dynamodb.rb', line 104

def put(id)
  table = my.resource(id)
  count = 0
  $stdin.each do |line|
    Aws::DynamoDB.put(table_name: table, item: JSON.parse(line))
    print '.' if options[:verbose]
    count += 1
  end
  print "\n" if options[:verbose]
  puts "put #{count} items to #{table}"
end