batchbook 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/README.txt +1 -1
  2. data/Rakefile +1 -1
  3. data/lib/batchbook.rb +63 -4
  4. metadata +9 -9
  5. data.tar.gz.sig +0 -2
  6. metadata.gz.sig +0 -0
data/README.txt CHANGED
@@ -4,7 +4,7 @@ http://github.com/batchblue/batchbook
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- Wrapper for BatchBook XML API
7
+ Wrapper for Batchbook XML API
8
8
 
9
9
  == API
10
10
 
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'hoe'
5
5
  require './lib/batchbook.rb'
6
6
 
7
7
  Hoe.new('batchbook', BatchBook::VERSION) do |p|
8
- p.developer('Will Larson', 'technical@batchblue.com')
8
+ p.developer('Will Larson', 'tech@batchblue.com')
9
9
 
10
10
  p.extra_deps << ['activeresource', '2.1.0']
11
11
  end
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'active_resource'
3
3
 
4
4
  # Ruby lib for working with the BatchBook's API's XML interface. Set the account
5
- # name and authentication token, using the BatchBook API Key found in your
5
+ # name and authentication token, using the Batchbook API Key found in your
6
6
  # account settings, and you're ready to roll.
7
7
  #
8
8
  # http://demo.batchbook.com
@@ -26,7 +26,7 @@ module BatchBook
26
26
  @account = name
27
27
  end
28
28
 
29
- # Sets the BatchBook API Key for all resources.
29
+ # Sets the Batchbook API Key for all resources.
30
30
  def token=(value)
31
31
  resources.each do |r|
32
32
  r.user = value
@@ -131,7 +131,7 @@ module BatchBook
131
131
 
132
132
  self.put(:add_tag, :tag => name)
133
133
  unless params.empty?
134
- self.put("super_tags/#{name.gsub(/ /, '_')}", :super_tag => params)
134
+ self.put("super_tags/#{name.gsub(/ /, '%20')}", :super_tag => params)
135
135
  end
136
136
  end
137
137
 
@@ -140,6 +140,11 @@ module BatchBook
140
140
  self.put(:add_tag, :tag => name)
141
141
  end
142
142
 
143
+ def add_tags names = []
144
+ raise Error, "Tag name not specified. Usage: person.add_tag('tag_name')" unless names
145
+ self.put(:add_tag, :tags => names)
146
+ end
147
+
143
148
  def remove_tag name
144
149
  raise Error, "Tag name not specified. Usage: person.remove_tag('tag_name')" unless name
145
150
  self.delete(:remove_tag, :tag => name)
@@ -188,11 +193,25 @@ module BatchBook
188
193
  raise Error, "SuperTag name not specified. Usage: person.supertag('tag_name')" unless name
189
194
  self.get('super_tags', :name => name)
190
195
  end
196
+
197
+ def add_supertag name, params = {}
198
+ raise Error, "Tag name not specified. Usage: person.add_supertag('tag_name')" unless name
199
+
200
+ self.put(:add_tag, :tag => name)
201
+ unless params.empty?
202
+ self.put("super_tags/#{name.gsub(/ /, '%20')}", :super_tag => params)
203
+ end
204
+ end
191
205
 
192
206
  def add_tag name
193
207
  raise Error, "Tag name not specified. Usage: person.add_tag('tag_name')" unless name
194
208
  self.put(:add_tag, :tag => name)
195
209
  end
210
+
211
+ def add_tags names = []
212
+ raise Error, "Tag name not specified. Usage: person.add_tag('tag_name')" unless names
213
+ self.put(:add_tag, :tags => names)
214
+ end
196
215
 
197
216
  def remove_tag name
198
217
  raise Error, "Tag name not specified. Usage: person.remove_tag('tag_name')" unless name
@@ -247,6 +266,16 @@ module BatchBook
247
266
  def comment(id)
248
267
  comments(id)
249
268
  end
269
+
270
+ def add_related_contact(contact_id)
271
+ raise Error, "Contact not specified. Usage: deal.add_contact(50)" unless contact_id
272
+ self.put(:add_related_contact, :contact_id => contact_id)
273
+ end
274
+
275
+ def remove_related_contact(contact_id)
276
+ raise Error, "Contact not specified. Usage: deal.add_contact(50)" unless contact_id
277
+ self.delete(:remove_related_contact, :contact_id => contact_id)
278
+ end
250
279
  end
251
280
 
252
281
  class Deal < Base
@@ -258,6 +287,11 @@ module BatchBook
258
287
  raise Error, "Tag name not specified. Usage: deal.add_tag('tag_name')" unless name
259
288
  self.put(:add_tag, :tag => name)
260
289
  end
290
+
291
+ def add_tags names = []
292
+ raise Error, "Tag name not specified. Usage: person.add_tag('tag_name')" unless names
293
+ self.put(:add_tag, :tags => names)
294
+ end
261
295
 
262
296
  def remove_tag name
263
297
  raise Error, "Tag name not specified. Usage: deal.remove_tag('tag_name')" unless name
@@ -285,6 +319,28 @@ module BatchBook
285
319
  raise Error, "Contact not specified. Usage: deal.add_contact(50)" unless contact_id
286
320
  self.delete(:remove_related_contact, :contact_id => contact_id)
287
321
  end
322
+
323
+ def statuses
324
+ self.get(:statuses)
325
+ end
326
+
327
+ def supertags
328
+ self.get('super_tags')
329
+ end
330
+
331
+ def supertag name
332
+ raise Error, "SuperTag name not specified. Usage: person.supertag('tag_name')" unless name
333
+ self.get('super_tags', :name => name)
334
+ end
335
+
336
+ def add_supertag name, params = {}
337
+ raise Error, "Tag name not specified. Usage: person.add_supertag('tag_name')" unless name
338
+
339
+ self.put(:add_tag, :tag => name)
340
+ unless params.empty?
341
+ self.put("super_tags/#{name.gsub(/ /, '%20')}", :super_tag => params)
342
+ end
343
+ end
288
344
  end
289
345
 
290
346
  class Communication < Base
@@ -384,7 +440,10 @@ module BatchBook
384
440
 
385
441
  class Record < Base
386
442
  end
387
-
443
+
444
+ class User < Base
445
+
446
+ end
388
447
  end
389
448
 
390
449
  __END__
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batchbook
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease: false
4
+ hash: 29
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 4
10
- version: 1.0.4
9
+ - 5
10
+ version: 1.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Will Larson
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-07-15 00:00:00 -04:00
19
+ date: 2011-05-22 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -35,9 +35,9 @@ dependencies:
35
35
  version: 2.3.5
36
36
  type: :runtime
37
37
  version_requirements: *id001
38
- description: Wrapper for BatchBook XML API
38
+ description: Wrapper for Batchbook XML API
39
39
  email:
40
- - technical@batchblue.com
40
+ - tech@batchblue.com
41
41
  executables: []
42
42
 
43
43
  extensions: []
@@ -83,9 +83,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  requirements: []
84
84
 
85
85
  rubyforge_project:
86
- rubygems_version: 1.3.7
86
+ rubygems_version: 1.6.2
87
87
  signing_key:
88
88
  specification_version: 3
89
- summary: Wrapper for BatchBook XML API
89
+ summary: Wrapper for Batchbook XML API
90
90
  test_files: []
91
91
 
data.tar.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- tp�|c0��N�9��q�g�b� �'>#;lH����3Q3s�=�j]w�#�-, $Q�'��M��5wz���9��U04�p�N��� �z�M-R�[��v�C�%���/ ���T_Px�E�xb�8W���E��Kf��
2
- 24����rY遳�@��C7�+G��Ҵu�E��$�ݙp"�}����M[�Bf.5��X�!�A5ff)����Q�a�u�L�1�~�����!Q�>U�橋����QJC7O�ꄓ
metadata.gz.sig DELETED
Binary file