closeio 0.0.1 → 0.0.2

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: daa2d5616721a1e2cc75b3e01dc0c727908136d9
4
- data.tar.gz: c6d7dfa07f8788fa15fd760b9d1de7fb0d19d8e4
3
+ metadata.gz: 1600ceff9b8b8494a591515b366f7424113acbae
4
+ data.tar.gz: b626c8c44011b2a2935070ba53121548a8f44248
5
5
  SHA512:
6
- metadata.gz: 5180e1431257b5308f9b7a7663424442ac799683a02881180de72660a5ec6bff4dec5941b1a40375d8a6f57dc03528e501dd0e3a371c7fcf2806d2c16a629489
7
- data.tar.gz: d15fbfb8687b2051f2a59ce66a3290655af6b83091c6abb38961f3c412c6247ae321ac50f3409635f5839387e661e39a10ede961c3ec5641828cc8a2071eeb15
6
+ metadata.gz: c67cb359a41f27b33d733c0d83a25e26395271e69d8b676e4832da091a2b5e6da40df7edaf20c7b05fe21fc061474081f682094485ff7c20d8cbde09e5a4f0a5
7
+ data.tar.gz: c94d6409db8dc05a739ea8c98308433f8b9320f2e5fed69a90bd213f1903584fbfb1a896ba2f046d825a5f0e51131bdee3e2aa39e0edc9e4d1b1d9c6eebe4935
data/Gemfile.lock CHANGED
@@ -23,6 +23,7 @@ PLATFORMS
23
23
  ruby
24
24
 
25
25
  DEPENDENCIES
26
+ bundler (~> 1.3)
26
27
  closeio!
27
28
  rake
28
29
  test-unit
data/README.md CHANGED
@@ -4,13 +4,16 @@ Learn about the Closeio API at http://developer.close.io.
4
4
 
5
5
  ### Installation
6
6
  Add this line to your application's Gemfile:
7
+ ````ruby
8
+ # in your Gemfile
7
9
  gem 'closeio'
8
10
 
9
- And then execute:
10
- $ bundle
11
+ # then...
12
+ bundle install
11
13
 
12
- Or install it yourself as:
13
- $ gem install closeio
14
+ # Add your Close.io api key as an ENV variable
15
+ ENV['CLOSEIO_API_KEY']='xxxxxxxx'
16
+ ````
14
17
 
15
18
  ### Usage
16
19
  ````ruby
@@ -25,8 +28,11 @@ Or install it yourself as:
25
28
  # Find leads that match fields
26
29
  Closeio::Lead.where query: 'custom.current_system:[Simple Donation]'
27
30
 
31
+ # Create a lead
32
+ Closeio::Lead.create name: "Bluth Company", contacts: [{name: "Buster Bluth", emails: [{email: "cartographer@bluthcompany.com"}]}]
33
+
28
34
  # Saved Search (SmartView)
29
- saved_search = Closeio::SavedSearch.first
35
+ saved_search = Closeio::SavedSearch.all.first
30
36
  saved_search.leads
31
37
  ````
32
38
 
data/lib/closeio/base.rb CHANGED
@@ -5,7 +5,7 @@ module Closeio
5
5
  base_uri 'https://app.close.io/api/v1'
6
6
  basic_auth ENV['CLOSEIO_API_KEY'], ''
7
7
  headers 'Content-Type' => 'application/json'
8
- debug_output $stdout
8
+ #debug_output $stdout
9
9
  format :json
10
10
 
11
11
  extend Forwardable
@@ -39,7 +39,7 @@ module Closeio
39
39
  end
40
40
  end
41
41
 
42
- # Closeio::Lead.create(name: "Brooks Company", contacts: [{name: "Wyatt Brooks", emails: [{email: "wyatt@gmail.com"}]}]
42
+ # Closeio::Lead.create name: "Bluth Company", contacts: [{name: "Buster Bluth", emails: [{email: "cartographer@bluthcompany.com"}]}]
43
43
  def create opts={}
44
44
  res = post resource_path, body: opts.to_json
45
45
  res.success? ? new(res) : bad_response(res)
@@ -52,7 +52,7 @@ module Closeio
52
52
  def destroy
53
53
  if res['data'].is_a? Array
54
54
  raise "Yo I'm an array"
55
-
55
+ else
56
56
  delete "#{resource_path}#{id}"
57
57
  end
58
58
 
data/lib/closeio/lead.rb CHANGED
@@ -12,5 +12,9 @@ module Closeio
12
12
  bad_response res
13
13
  end
14
14
  end
15
+
16
+ def contact
17
+ self.contacts.first
18
+ end
15
19
  end
16
20
  end
@@ -1,3 +1,7 @@
1
1
  module Closeio
2
- class SavedSearch < Base; end
2
+ class SavedSearch < Base
3
+ def leads
4
+ Closeio::Lead.where query: self.query
5
+ end
6
+ end
3
7
  end
@@ -1,3 +1,3 @@
1
1
  module Closeio
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: closeio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-04 00:00:00.000000000 Z
11
+ date: 2013-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crack
@@ -127,8 +127,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.0.2
130
+ rubygems_version: 2.0.3
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: A Ruby wrapper for the CloseIO API
134
134
  test_files: []
135
+ has_rdoc: