prosperworks-ruby 0.1.0 → 0.1.1
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/CHANGELOG.md +12 -0
- data/README.md +64 -36
- data/bin/console +1 -1
- data/lib/prosperworks/api_operations/connect.rb +2 -2
- data/lib/prosperworks/base.rb +1 -1
- data/lib/prosperworks/utils.rb +3 -5
- data/lib/prosperworks/version.rb +1 -1
- data/prosperworks-ruby.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 178f861fcbab618ab5d7868804aaff682fec7afe
|
4
|
+
data.tar.gz: e50f45003f905d514bb09bc58e4ce8a44773fe74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d711c8ca0e924dc2359ebe4401c44395ad39338bf223a5440d6059a0408bdcb9370a952a7c6e5c49a351c9355e7382c40ce1eb787b88ed26555223e9252b995e
|
7
|
+
data.tar.gz: 04f910b8d9d2efb1e1a77a0b1a37ecc83ee8524b6d311d9e1559cb88e1aff6ee5da90ce454a5f9aed20a45aab5b36c5fa5264c2a51e2f4fab407a9d76332b099
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# ProsperWorks-Ruby
|
2
2
|
|
3
3
|
A lightweight wrapper for interacting with the [ProsperWorks Developer API](https://www.prosperworks.com/developer_api).
|
4
4
|
|
@@ -21,7 +21,7 @@ Or install it yourself as:
|
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
-
This gem offers
|
24
|
+
This gem offers basic operations to interact with the ProsperWorks Developer API. There is minimal error handling and no validation logic.
|
25
25
|
|
26
26
|
To use the proper credentials, the following must be run before using the gem:
|
27
27
|
|
@@ -32,45 +32,68 @@ ProsperWorks.configure do |config|
|
|
32
32
|
end
|
33
33
|
```
|
34
34
|
|
35
|
-
|
35
|
+
### Create
|
36
|
+
|
37
|
+
```
|
38
|
+
person = ProsperWorks::Person.create(attributes)
|
39
|
+
|
40
|
+
opportunity = ProsperWorks::Opportunity.create({
|
41
|
+
pipeline_id: <some_id>,
|
42
|
+
company_id: <another_id>,
|
43
|
+
monetary_value: 1_000
|
44
|
+
})
|
45
|
+
|
46
|
+
```
|
47
|
+
|
48
|
+
### Find
|
49
|
+
|
50
|
+
```
|
51
|
+
person = ProsperWorks::Person.find(id)
|
52
|
+
|
53
|
+
lead = ProsperWorks::Lead.find(423)
|
54
|
+
```
|
55
|
+
|
56
|
+
### Update
|
57
|
+
|
58
|
+
For update, either update the object in advance:
|
59
|
+
|
60
|
+
```
|
61
|
+
person.name = "A New Name"
|
62
|
+
response = ProsperWorks::Person.update(person)
|
63
|
+
```
|
64
|
+
|
65
|
+
or pass in a hash of attributes to update:
|
66
|
+
|
67
|
+
```
|
68
|
+
attributes = {
|
69
|
+
name: "A New Name"
|
70
|
+
}
|
71
|
+
response = ProsperWorks::Person.update(person, attributes)
|
72
|
+
|
36
73
|
```
|
37
|
-
person = ProsperWorks::Person.find(id)
|
38
74
|
|
39
|
-
|
75
|
+
### Delete
|
76
|
+
|
77
|
+
```
|
78
|
+
response = ProsperWorks::Person.delete(person.id)
|
40
79
|
|
41
|
-
|
42
|
-
# For update, either update the object in advance, or pass
|
43
|
-
# in a hash of attributes to update
|
44
|
-
#
|
45
|
-
person.name = "some new name"
|
46
|
-
response = ProsperWorks::Person.update(person)
|
47
|
-
# --- OR ---
|
48
|
-
response = ProsperWorks::Person.update(person, attributes)
|
80
|
+
```
|
49
81
|
|
50
|
-
|
82
|
+
### List (webhooks only)
|
51
83
|
|
84
|
+
```
|
85
|
+
webhooks = ProsperWorks::Webhook.list
|
52
86
|
```
|
53
87
|
|
54
88
|
The following entity types are currently supported:
|
55
89
|
* Person
|
56
90
|
* Lead
|
57
|
-
*
|
91
|
+
* Company
|
58
92
|
* Opportunity
|
59
93
|
* Task
|
60
94
|
* Project
|
61
95
|
* Webhook
|
62
96
|
|
63
|
-
The following operations are currently supported:
|
64
|
-
* Create
|
65
|
-
* Find
|
66
|
-
* Update
|
67
|
-
* Delete
|
68
|
-
* List (only for webhooks)
|
69
|
-
|
70
|
-
```
|
71
|
-
webhooks = ProsperWorks::Webhook.list
|
72
|
-
```
|
73
|
-
|
74
97
|
The response will either be an instance of `ProsperWorks::Errors`, or the entity itself. See the `handle_response` function in [connect.rb](lib/prosperworks/api_operations/connect.rb).
|
75
98
|
|
76
99
|
## Development
|
@@ -86,20 +109,25 @@ This gem is fairly new, and can benefit from contributions!
|
|
86
109
|
You can take a look at the [issues](https://github.com/soccernee/prosperworks-ruby/issues) and start by contributing there.
|
87
110
|
|
88
111
|
Wishlist
|
89
|
-
[] continuous integration setup
|
90
|
-
[] add [Rubocop](https://github.com/bbatsov/rubocop)
|
91
|
-
[] code cleanup & refactoring
|
92
|
-
[] improved testing
|
93
|
-
[] search endpoint
|
94
|
-
[] Users API
|
95
|
-
[] Activities API
|
96
|
-
[] Related Items API
|
97
|
-
[] Secondary Resources APIs
|
98
|
-
[] Support for Nested Resources
|
112
|
+
- [ ] continuous integration setup
|
113
|
+
- [ ] add [Rubocop](https://github.com/bbatsov/rubocop)
|
114
|
+
- [ ] code cleanup & refactoring
|
115
|
+
- [ ] improved testing
|
116
|
+
- [ ] search endpoint
|
117
|
+
- [ ] Users API
|
118
|
+
- [ ] Activities API
|
119
|
+
- [ ] Related Items API
|
120
|
+
- [ ] Secondary Resources APIs
|
121
|
+
- [ ] Support for Nested Resources
|
99
122
|
|
100
123
|
|
101
124
|
Bug reports and pull requests are welcome on GitHub at https://github.com/soccernee/prosperworks-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
102
125
|
|
126
|
+
To run the tests:
|
127
|
+
```
|
128
|
+
rake test
|
129
|
+
```
|
130
|
+
|
103
131
|
## License
|
104
132
|
|
105
133
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/bin/console
CHANGED
@@ -23,10 +23,10 @@ module ProsperWorks
|
|
23
23
|
request = Net::HTTP::Get.new(uri.request_uri, headers)
|
24
24
|
when "post"
|
25
25
|
request = Net::HTTP::Post.new(uri.request_uri, headers)
|
26
|
-
request.body = entity.
|
26
|
+
request.body = entity.serialize_pw_entity
|
27
27
|
when "put"
|
28
28
|
request = Net::HTTP::Put.new(uri.request_uri, headers)
|
29
|
-
request.body = entity.
|
29
|
+
request.body = entity.serialize_pw_entity
|
30
30
|
when "delete"
|
31
31
|
request = Net::HTTP::Delete.new(uri.request_uri, headers)
|
32
32
|
end
|
data/lib/prosperworks/base.rb
CHANGED
data/lib/prosperworks/utils.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'json'
|
2
|
-
require 'json/add/core' # enables serializing of Time and other things
|
3
2
|
|
4
3
|
module ProsperWorks
|
5
4
|
|
@@ -7,11 +6,10 @@ module ProsperWorks
|
|
7
6
|
# Modified version of the Jsonable gem, all credit goes to the
|
8
7
|
# authors of that gem
|
9
8
|
#
|
10
|
-
module
|
9
|
+
module SerializeEntity
|
11
10
|
|
12
|
-
def
|
11
|
+
def serialize_pw_entity(*a)
|
13
12
|
result = {}
|
14
|
-
result['json_class'] = self.class.name
|
15
13
|
self.instance_variables.each do |var|
|
16
14
|
trimmed_var = var.to_s.gsub!("@", "")
|
17
15
|
result[trimmed_var] = self.instance_variable_get var
|
@@ -21,4 +19,4 @@ module ProsperWorks
|
|
21
19
|
|
22
20
|
end
|
23
21
|
|
24
|
-
end
|
22
|
+
end
|
data/lib/prosperworks/version.rb
CHANGED
data/prosperworks-ruby.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Neeraj Chandra"]
|
10
10
|
spec.email = ["nchandra324@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{A
|
12
|
+
spec.summary = %q{A Ruby gem for the ProsperWorks Developer API}
|
13
13
|
spec.description = %q{A lightweight interface for the ProsperWorks Developer API}
|
14
14
|
spec.homepage = "https://rubygems.org/gems/prosperworks-ruby"
|
15
15
|
spec.license = "MIT"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prosperworks-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neeraj Chandra
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -75,6 +75,7 @@ extra_rdoc_files: []
|
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
77
|
- ".travis.yml"
|
78
|
+
- CHANGELOG.md
|
78
79
|
- CODE_OF_CONDUCT.md
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE.txt
|
@@ -135,5 +136,5 @@ rubyforge_project:
|
|
135
136
|
rubygems_version: 2.6.12
|
136
137
|
signing_key:
|
137
138
|
specification_version: 4
|
138
|
-
summary: A
|
139
|
+
summary: A Ruby gem for the ProsperWorks Developer API
|
139
140
|
test_files: []
|