sugarcrb 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +65 -1
- data/lib/sugarcrb/version.rb +1 -1
- data/sugarcrb.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: abef30c9fdda65054c091efa0145e080991d5241
|
4
|
+
data.tar.gz: 58b620f89c324e72d26b61bb54482cde2fb0e286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d93162c29bfb4acfe7a95d95a94d997238b6206f09702b7f03edf5fcc911ad0420607b68945e1bc6fef0e84403266d0780e91a1967552a0d1e6e86f3e195f85d
|
7
|
+
data.tar.gz: c45f76fa1ba8145366ed688ef278acefb71970cc050f40d1be5d6a96ebe5c682b6a78a7bda595c0ffc2a3600e799885d1799e2d52e7218f94abe9cec4e5977b9
|
data/README.md
CHANGED
@@ -22,7 +22,71 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
Login
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
sugarcrb = Sugarcrb.new(<host>,<username>,<password>,<platform>,<client id>,<client secret>)
|
29
|
+
|
30
|
+
sugarcrb = Sugarcrb.new("https://instance.sugarondemand.com","admin","xxxxxx","test","sugar","")
|
31
|
+
```
|
32
|
+
|
33
|
+
Call endpoint
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
response = sugarcrb.call "<method>", "<url endpoint>", <data>
|
37
|
+
```
|
38
|
+
|
39
|
+
Create a bean
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
response = sugarcrb.call "post", "<module>", <data>
|
43
|
+
response = sugarcrb.call "post", "Accounts", {
|
44
|
+
"name" => "My Account"
|
45
|
+
}
|
46
|
+
account_data = JSON.load(response)
|
47
|
+
```
|
48
|
+
|
49
|
+
List beans
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
response = sugarcrb.call "get", "<module>"
|
53
|
+
|
54
|
+
response = sugarcrb.call "get", "Accounts"
|
55
|
+
accounts_data = JSON.load(response)
|
56
|
+
accounts_data['records']
|
57
|
+
```
|
58
|
+
|
59
|
+
Get a bean
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
response = sugarcrb.call "get", "<module>/<id>"
|
63
|
+
|
64
|
+
response = sugarcrb.call "get", "Accounts/dffe626e-08d2-11e7-9113-06b20b8677ed"
|
65
|
+
account_data = JSON.load(response)
|
66
|
+
```
|
67
|
+
|
68
|
+
Update a bean
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
response = sugarcrb.call "put", "<module>/<id>", <data>
|
72
|
+
|
73
|
+
response = sugarcrb.call "put", "Accounts/dffe626e-08d2-11e7-9113-06b20b8677ed", {
|
74
|
+
"name" => "My Favorite Account"
|
75
|
+
}
|
76
|
+
account_data = JSON.load(response)
|
77
|
+
```
|
78
|
+
|
79
|
+
Delete a bean
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
response = sugarcrb.call "delete", "<module>/<id>"
|
83
|
+
|
84
|
+
response = sugarcrb.call "delete", "Accounts/dffe626e-08d2-11e7-9113-06b20b8677ed"
|
85
|
+
if response.code == 200 then
|
86
|
+
puts "deleted"
|
87
|
+
end
|
88
|
+
```
|
89
|
+
|
26
90
|
|
27
91
|
## Development
|
28
92
|
|
data/lib/sugarcrb/version.rb
CHANGED
data/sugarcrb.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["pedroalbertose007@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = "Sugarcrm client"
|
13
|
-
spec.description = "Gem to
|
13
|
+
spec.description = "Gem to create a client to Consume SugarCRM's API rest V10"
|
14
14
|
spec.homepage = "https://rubygems.org/gems/sugarcrb"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sugarcrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- betobaz
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.3'
|
83
|
-
description: Gem to
|
83
|
+
description: Gem to create a client to Consume SugarCRM's API rest V10
|
84
84
|
email:
|
85
85
|
- pedroalbertose007@gmail.com
|
86
86
|
executables: []
|