closeio 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ddc839deb2264fe2d34c590098f383a29c34c2a
4
- data.tar.gz: 0157f8b6a28fe2a9b870fdc2f603d37c0d37dda0
3
+ metadata.gz: 4a1a13aafac29d1f3bf6a4a3371ee17cc5220fc9
4
+ data.tar.gz: 2409ed93ab181ff700ba66bc5cd50413837848ed
5
5
  SHA512:
6
- metadata.gz: 6ac847f9bc6659f23aa3b5f9dc4199bea46c3f197cfaeefb0a4b54bad02f2cc86e083e4a6e46f516a4702ef58c0638adbeb10e3f42750dc923636041289e5794
7
- data.tar.gz: 5763708b146d913b482fe5a5ec8cf61d498e99e6b78e3b767e56687e30482d99e5657ed070e33ebe7a7024b480b0a576f2d5bb723d7b05d613759a6b9291df78
6
+ metadata.gz: 9daca88badb5a9f82f44a7e0b5a73b53af2ceae2a807125e0d2a5771344b6003dc75253d3e9d65e0ac56a7d431310625fd9065f5487e14c6bc6c6d5e7994231c
7
+ data.tar.gz: b3ead07cddf432c44f6dbb9a879bc520289fbed247c57b22ea401e6a03c19482a9109c208964c8c2131263ed95efa5335cbbf70f954f24f1b172350858de36c6
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Learn about the Closeio API at http://developer.close.io.
4
4
 
5
+ I :heart: Close.io, so if you have problems using the gem or would like to see support for new endpoints, please open a GitHub issue -- I'll get it resolved as quick as I can.
6
+
5
7
  ### Installation
6
8
  Add this line to your application's Gemfile:
7
9
  ````ruby
@@ -11,14 +13,14 @@ Add this line to your application's Gemfile:
11
13
  # then...
12
14
  bundle install
13
15
 
14
- # Set your Api Key (in a `config/initializer` or `config/environment/*`)
16
+ # Set your Api Key (`config/initializers/closeio.rb` or `config/environment/*.rb`)
15
17
  Closeio.configure("xxxxxx")
16
18
  ````
17
19
 
18
20
  ### Usage
19
21
  ````ruby
20
22
  # Find a specific lead
21
- lead = Closeio::Lead.find 'lead_xxxxxxxxxxxx'
23
+ lead = Closeio::Lead.find('lead_xxxxxxxxxxxx')
22
24
 
23
25
  # See some data about the lead
24
26
  lead.addresses
@@ -26,16 +28,23 @@ Add this line to your application's Gemfile:
26
28
  lead.opportunities
27
29
 
28
30
  # Find leads that match fields
29
- Closeio::Lead.where query: 'custom.current_system:[Simple Donation]'
31
+ Closeio::Lead.where(query: 'custom.current_system:[Simple Donation]')
30
32
 
31
33
  # Create a lead
32
- Closeio::Lead.create name: "Bluth Company", contacts: [{name: "Buster Bluth", emails: [{type: "office", email: "cartographer@bluthcompany.com"}]}]
34
+ Closeio::Lead.create(
35
+ name: "Bluth Company",
36
+ contacts: [{
37
+ name: "Buster Bluth",
38
+ emails: [{type: "office", email: "cartographer@bluthcompany.com"}]
39
+ }]
40
+ )
33
41
 
34
42
  # Saved Search (SmartView)
35
43
  saved_search = Closeio::SavedSearch.all.first
36
44
  saved_search.leads
37
45
  ````
38
46
 
47
+
39
48
  ### Contributing
40
49
 
41
50
  1. Fork it
@@ -46,4 +55,4 @@ Add this line to your application's Gemfile:
46
55
 
47
56
 
48
57
  ### Copyright
49
- Copyright (c) 2013 Taylor Brooks. See LICENSE for details.
58
+ Copyright (c) 2015 Taylor Brooks. See LICENSE for details.
data/lib/closeio.rb CHANGED
@@ -28,4 +28,12 @@ module Closeio
28
28
  def self.configure(api_key=nil)
29
29
  Base.configure(api_key)
30
30
  end
31
+
32
+ def self.reset
33
+ Closeio::Base.default_options[:basic_auth][:username] = nil
34
+
35
+ Closeio::Base.descendants.each do |resource|
36
+ resource.default_options[:basic_auth][:username] = nil
37
+ end
38
+ end
31
39
  end
data/lib/closeio/base.rb CHANGED
@@ -12,7 +12,7 @@ module Closeio
12
12
 
13
13
  attr_reader :data
14
14
 
15
- def initialize attrs={}
15
+ def initialize(attrs={})
16
16
  if attrs['data']
17
17
  super attrs['data']
18
18
  else
@@ -1,3 +1,3 @@
1
1
  module Closeio
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
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: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-28 00:00:00.000000000 Z
11
+ date: 2014-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crack