Class: Flydata::Api::DataEntry

Inherits:
Base
  • Object
show all
Defined in:
lib/flydata/api/data_entry.rb

Instance Method Summary collapse

Methods inherited from Base

#create, #list

Constructor Details

#initialize(api_client) ⇒ DataEntry

Returns a new instance of DataEntry.



6
7
8
9
10
# File 'lib/flydata/api/data_entry.rb', line 6

def initialize(api_client)
  @model_name = 'data_entry'
  @url_path = "/data_ports/:data_port_id/#{@model_name.pluralize}"
  super
end

Instance Method Details

#buffer_stat(data_entry_id, params = {}) ⇒ Object



12
13
14
15
# File 'lib/flydata/api/data_entry.rb', line 12

def buffer_stat(data_entry_id, params = {})
  tables = params[:tables] ? params[:tables].join(',') : ''
  @client.get("/#{@model_name.pluralize}/#{data_entry_id}/buffer_stat/#{params[:mode]}?tables=#{tables}")
end

#cleanup_sync(data_entry_id, tables) ⇒ Object



17
18
19
# File 'lib/flydata/api/data_entry.rb', line 17

def cleanup_sync(data_entry_id, tables)
  @client.post("/#{@model_name.pluralize}/#{data_entry_id}/cleanup_sync", nil, {tables: tables.join(',')})
end