Sha256: a3780585f549105dfbcec42e450e7f3d3127e8a8896b15efdac2622062add1bc

Contents?: true

Size: 700 Bytes

Versions: 2

Compression:

Stored size: 700 Bytes

Contents

require 'kintone/command'
require 'kintone/api'

class Kintone::Command::Records
  PATH = "records"

  def initialize(api)
    @api = api
    @url = @api.get_url(PATH)
  end

  def get(app, query, fields)
    params = {:app => app, :query => query}
    fields.each_with_index {|v, i| params["fields[#{i}]"] = v}
    return @api.get(@url, params)
  end

  def create(app, records)
    return @api.post(@url, {:app => app, :records => records})
  end

  def update(app, records)
    return @api.put(@url, {:app => app, :records => records})
  end

  def delete(app, ids)
    params = {:app => app}
    ids.each_with_index {|v, i| params["ids[#{i}]"] = v}
    return @api.delete(@url, params)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kintone-0.0.4 lib/kintone/command/records.rb
kintone-0.0.3 lib/kintone/command/records.rb