lancerkit 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/lancerkit.rb +53 -0
  3. metadata +57 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e1f79e493113ceffa698f6a7ef7198cf0e0d42c084c64ac2ae5541175f95d8d4
4
+ data.tar.gz: a6497bfc19a394d133afcae981301b788effbe6cfcad7fb6840aab3c6b134bfb
5
+ SHA512:
6
+ metadata.gz: 2a71987fcafd0c9fe20587578b730895ed35b28ced78fd24e70b87e85bf9df053970e74ced582e542c79c7f2a6f1ed9c659be3a7d783f7dc2200a053923d5407
7
+ data.tar.gz: 7b32eb7efdd61d06c426706aebecfb4b3f7cdf47373e43baeda5a03cfb1ab28c9fc38a4347625f55c5dc5a4214cf07df55b63c7031fd0cf4c7452f20302ce916
data/lib/lancerkit.rb ADDED
@@ -0,0 +1,53 @@
1
+ require 'httparty'
2
+
3
+ HOST = 'https://api.lancerkit.com'
4
+
5
+ class Lancerkit
6
+ def initialize(api_key)
7
+ @api_key = api_key
8
+ end
9
+
10
+ def list_documents(sort='-date', page=0)
11
+ HTTParty.get(HOST + "/documents", {query: {sort:sort, page: page}, headers: {authorization: @api_key}})
12
+ end
13
+
14
+ def list_contacts(sort='-date', page=0)
15
+ HTTParty.get(HOST + "/contacts", {query: {sort:sort, page: page}, headers: {authorization: @api_key}})
16
+ end
17
+
18
+ def list_transactions(sort='-date', page=0)
19
+ HTTParty.get(HOST + "/transactions", {query: {sort:sort, page: page}, headers: {authorization: @api_key}})
20
+ end
21
+
22
+ def create_document(data)
23
+ self.edit_document('new', data)
24
+ end
25
+
26
+ def create_contact(data)
27
+ self.edit_contact('new', data)
28
+ end
29
+
30
+ def edit_documents(id, data)
31
+ HTTParty.get(HOST + "/documents/#{id}", {body: data.to_json, headers: {authorization: @api_key, 'Content-Type': 'application/json'}})
32
+ end
33
+
34
+ def edit_contacts(id, data)
35
+ HTTParty.get(HOST + "/contacts/#{id}", {body: data.to_json, headers: {authorization: @api_key, 'Content-Type': 'application/json'}})
36
+ end
37
+
38
+ def edit_transactions(id, data)
39
+ HTTParty.get(HOST + "/transactions/#{id}", {body: data.to_json, headers: {authorization: @api_key, 'Content-Type': 'application/json'}})
40
+ end
41
+
42
+ def delete_documents(ids)
43
+ HTTParty.post(HOST + "/documents/delete", {body: ids.to_json, headers: {authorization: @api_key, 'Content-Type': 'application/json'}})
44
+ end
45
+
46
+ def delete_contacts(ids)
47
+ HTTParty.post(HOST + "/contacts/delete", {body: ids.to_json, headers: {authorization: @api_key, 'Content-Type': 'application/json'}})
48
+ end
49
+
50
+ def delete_transactions(ids)
51
+ HTTParty.post(HOST + "/transactions/delete", {body: ids.to_json, headers: {authorization: @api_key, 'Content-Type': 'application/json'}})
52
+ end
53
+ end
metadata ADDED
@@ -0,0 +1,57 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lancerkit
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Alexis Clarembeau
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-02-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Ruby SDK for Lancerkit API
28
+ email: contact@lancerkit.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/lancerkit.rb
34
+ homepage: https://lancerkit.com
35
+ licenses:
36
+ - MIT
37
+ metadata: {}
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubygems_version: 3.3.7
54
+ signing_key:
55
+ specification_version: 4
56
+ summary: Lancerkit
57
+ test_files: []