Class: Kintone::Command::Record
Class Method Summary
collapse
Instance Method Summary
collapse
#initialize
Class Method Details
4
5
6
|
# File 'lib/kintone/command/record.rb', line 4
def self.path
'record'
end
|
Instance Method Details
#create(app, record) ⇒ Object
16
17
18
|
# File 'lib/kintone/command/record.rb', line 16
def create(app, record)
register(app, record)
end
|
#get(app, id) ⇒ Object
8
9
10
|
# File 'lib/kintone/command/record.rb', line 8
def get(app, id)
@api.get(@url, app: app, id: id)
end
|
#register(app, record) ⇒ Object
12
13
14
|
# File 'lib/kintone/command/record.rb', line 12
def register(app, record)
@api.post(@url, app: app, record: record.to_kintone)
end
|
#update(app, id, record, revision: nil) ⇒ Object
20
21
22
23
24
|
# File 'lib/kintone/command/record.rb', line 20
def update(app, id, record, revision: nil)
body = { app: app, id: id, record: record.to_kintone }
body[:revision] = revision if revision
@api.put(@url, body)
end
|