velocify 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d7d3962780f0757bf6fecac5b63a2eb439f5193
4
- data.tar.gz: 404519cd5a282183841b133a47c013b6cd2cb3f3
3
+ metadata.gz: f32846f7d19ac4c67e7cabe1a12d29d567f3383f
4
+ data.tar.gz: 70def166f0ab97b89513fdca651313a83be4caaa
5
5
  SHA512:
6
- metadata.gz: 58e5fe96161f78a37d785fbda604aa756facd93334c7abd9c2f545472d23bdc3e2c5b3d986e6bf49816781370d0173cef2430acef66fc317b7539c930703de8d
7
- data.tar.gz: 3b7eedb6aca41a7df0593728f4ad4bfe727727eb6fd4b844b504f9ade20939a401a3d2a0e7c4ac1a480c38ecde45b907cd01a943d54bb57609b656d6baaeb237
6
+ metadata.gz: 47f4465c15aa8703d8d16059324fff481df9b263893732aaaa5d6b20f918d3c8fc431d2bc2fe3b25e61dc6c33d6b60bd0c1634ae5b28d86e44165be507f5ece7
7
+ data.tar.gz: 59abbd3f3f08a382c6e0a25a416eedc84b3f318b687e50d66942107cd1a8e619244c6033b4e679f9de7682c7240bd3e6d1f8b6b0b068b1d382d22a0be5825766
data/.gitignore CHANGED
@@ -10,3 +10,5 @@
10
10
  *~
11
11
  .env
12
12
  *.gem
13
+ .ruby-version
14
+ *.swp
@@ -2,3 +2,7 @@ language: ruby
2
2
  rvm:
3
3
  - 2.2.3
4
4
  before_install: gem install bundler -v 1.10.6
5
+ script: bundle exec rake test
6
+ addons:
7
+ code_climate:
8
+ repo_token: 390e6c3bd4187c953584a19a731574270e8fc509e975c682e4cd8f2bace18bee
@@ -1,3 +1,39 @@
1
+ # Changes in 0.1.5
2
+
3
+ * Fixes bug in ```return_array: ``` option for ```Velocify::Lead.add```
4
+ * Adds new feature for retrieving all reports
5
+
6
+ ``` ruby
7
+ Velocify::Report.find_all
8
+ ```
9
+
10
+ * Adds new feature for retrieving the results of a report
11
+
12
+ ``` ruby
13
+ Velocify::Report.find_results id: 89
14
+ ```
15
+
16
+ # Changes in 0.1.4
17
+
18
+ * ```Velocify::Lead.add``` now works:
19
+
20
+ ``` ruby
21
+ lead = Velocify::Lead.new
22
+ lead.status_id = 13
23
+ lead.campaign_id = 35
24
+ lead.agent_id = 89
25
+ lead.add_field id: 2, value: "First"
26
+ lead.add_field id: 3, value: "Lead"
27
+
28
+ Velocify::Lead.add leads: [lead]
29
+ ```
30
+
31
+ * Support for retrieving agents
32
+
33
+ ``` ruby
34
+ agents = Velocify::Agent.find_all return_array: true
35
+ ```
36
+
1
37
  # Changes in 0.1.3
2
38
 
3
39
  * All model classes now support the optional keyword argument ```return_array:``` if you want to receive
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem "codeclimate-test-reporter", group: :test, require: nil
4
+
3
5
  gemspec
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Velocify
2
2
  [![Gem Version](https://badge.fury.io/rb/velocify.svg)](http://badge.fury.io/rb/velocify)
3
3
  [![Code Climate](https://codeclimate.com/github/pennymac/velocify/badges/gpa.svg)](https://codeclimate.com/github/pennymac/velocify)
4
+ [![Build Status](https://travis-ci.org/pennymac/velocify.svg)](https://travis-ci.org/pennymac/velocify)
5
+ [![Test Coverage](https://codeclimate.com/github/pennymac/velocify/badges/coverage.svg)](https://codeclimate.com/github/pennymac/velocify/coverage)
4
6
 
5
7
  ## Installation
6
8
 
@@ -58,17 +60,13 @@ status_id = Velocify::ResponseReader.read(kind: :status, response: Velocify::Sta
58
60
  last_name_id = Velocify::ResponseReader.read(kind: :field, response: Velocify::Field.find_all).find_id_by_title 'Last Name'
59
61
  first_name_id = Velocify::ResponseReader.read(kind: :field, response: Velocify::Field.find_all).find_id_by_title 'First Name'
60
62
 
61
- lead = Lead.new
63
+ lead = Velocify::Lead.new
62
64
  lead.campaign_id = campaign_id
63
65
  lead.status_id = status_id
64
66
  lead.add_field id: first_name_id, value: "Joe"
65
67
  lead.add_field id: last_name_id, value: "Bo"
66
68
 
67
- list = Velocify::LeadList.new
68
- list.add_lead lead
69
- xml_payload = list.render # Renders xml output
70
-
71
- Velocify::Lead.add leads: xml_payload
69
+ Velocify::Lead.add leads: [ lead ]
72
70
  ```
73
71
 
74
72
  ## Changes
@@ -11,6 +11,7 @@ require "velocify/field"
11
11
  require "velocify/field_type"
12
12
  require "velocify/lead"
13
13
  require "velocify/status"
14
+ require "velocify/report"
14
15
 
15
16
  require "velocify/response_reader"
16
17
  require "velocify/message_payload"
@@ -36,7 +36,7 @@ module Velocify
36
36
  xml AddLeadsPayload.new(leads)
37
37
  transform do |resp|
38
38
  if return_array
39
- arrayify resp[:leads][:lead]
39
+ arrayify resp[:response][:additions][:lead]
40
40
  else
41
41
  resp
42
42
  end
@@ -0,0 +1,42 @@
1
+ module Velocify
2
+ class Report
3
+ include Model
4
+
5
+ class << self
6
+ def find_all destruct: false, return_array: false
7
+ verify_credentials!
8
+
9
+ request do
10
+ destruct_response? destruct
11
+ operation :get_reports
12
+ authenticate? true
13
+ transform do |resp|
14
+ if return_array
15
+ arrayify resp[:reports][:report]
16
+ else
17
+ resp
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ def find_results report_id:, template_values: nil, destruct: false, return_array: false
24
+ verify_credentials!
25
+
26
+ request do
27
+ destruct_response? destruct
28
+ operation :get_report_results
29
+ authenticate? true
30
+ message report_id: report_id
31
+ transform do |resp|
32
+ if return_array
33
+ arrayify resp[:report_results][:result]
34
+ else
35
+ resp
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -1,3 +1,3 @@
1
1
  module Velocify
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: velocify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Dyba
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-30 00:00:00.000000000 Z
11
+ date: 2015-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: savon
@@ -134,6 +134,7 @@ files:
134
134
  - lib/velocify/lead.rb
135
135
  - lib/velocify/message_payload.rb
136
136
  - lib/velocify/model.rb
137
+ - lib/velocify/report.rb
137
138
  - lib/velocify/response_reader.rb
138
139
  - lib/velocify/status.rb
139
140
  - lib/velocify/version.rb