Class: ExtraLoop::Storage::FusionTables

Inherits:
RemoteStore show all
Defined in:
lib/extraloop/redis-storage/remote_store/fusion_tables.rb

Constant Summary collapse

@@connection =
nil

Instance Method Summary collapse

Methods inherited from RemoteStore

get_transport, #initialize

Constructor Details

This class inherits a constructor from ExtraLoop::Storage::RemoteStore

Instance Method Details

#push(session) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/extraloop/redis-storage/remote_store/fusion_tables.rb', line 6

def push(session)
  @api = connect!
  dataset = session.to_hash
  records = dataset[:records]
  title   = dataset[:title].gsub(/\sDataset/,'')
  schema = make_schema(records.first)

  table = @api.create_table("Dataset #{title}", schema)
  table.insert records
end