the-city-admin 0.5.2 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/.rvmrc +1 -1
  3. data/examples/city_keys.rb +2 -2
  4. data/examples/donations.rb +33 -0
  5. data/lib/api/address_list.rb +4 -5
  6. data/lib/api/api_list.rb +50 -0
  7. data/lib/api/checkin_list.rb +4 -5
  8. data/lib/api/donation.rb +36 -18
  9. data/lib/api/donation_export_list.rb +4 -5
  10. data/lib/api/donation_list.rb +5 -7
  11. data/lib/api/fund_list.rb +5 -7
  12. data/lib/api/group_address_list.rb +4 -5
  13. data/lib/api/group_checkin_list.rb +4 -5
  14. data/lib/api/group_event_attendance_list.rb +4 -5
  15. data/lib/api/group_export.rb +1 -0
  16. data/lib/api/group_export_list.rb +4 -5
  17. data/lib/api/group_invitation_list.rb +4 -5
  18. data/lib/api/group_list.rb +5 -7
  19. data/lib/api/group_role_list.rb +4 -5
  20. data/lib/api/group_tag_list.rb +4 -5
  21. data/lib/api/invitation_list.rb +4 -5
  22. data/lib/api/metric_list.rb +5 -6
  23. data/lib/api/metric_measurement_list.rb +5 -6
  24. data/lib/api/pledge_list.rb +5 -7
  25. data/lib/api/role_list.rb +5 -6
  26. data/lib/api/skill_list.rb +5 -6
  27. data/lib/api/skilled_user_id_list.rb +5 -6
  28. data/lib/api/skilled_user_list.rb +5 -6
  29. data/lib/api/tag_group_list.rb +5 -6
  30. data/lib/api/tag_list.rb +5 -6
  31. data/lib/api/terminology_list.rb +5 -6
  32. data/lib/api/user.rb +24 -23
  33. data/lib/api/user_address.rb +17 -12
  34. data/lib/api/user_address_list.rb +4 -5
  35. data/lib/api/user_admin_privilege_list.rb +5 -6
  36. data/lib/api/user_family_list.rb +5 -4
  37. data/lib/api/user_invitation_list.rb +5 -6
  38. data/lib/api/user_list.rb +5 -6
  39. data/lib/api/user_note_list.rb +5 -6
  40. data/lib/api/user_process_answer_list.rb +5 -6
  41. data/lib/api/user_process_list.rb +5 -6
  42. data/lib/api/user_role_list.rb +5 -6
  43. data/lib/api/user_skill_list.rb +5 -6
  44. data/lib/api/web_hook_list.rb +5 -6
  45. data/lib/auto_load.rb +1 -0
  46. data/lib/readers/address_list_reader.rb +6 -2
  47. data/lib/readers/checkin_list_reader.rb +7 -2
  48. data/lib/readers/donation_export_list_reader.rb +7 -2
  49. data/lib/readers/donation_list_reader.rb +6 -1
  50. data/lib/readers/fund_list_reader.rb +6 -1
  51. data/lib/readers/group_address_list_reader.rb +8 -3
  52. data/lib/readers/group_checkin_list_reader.rb +8 -3
  53. data/lib/readers/group_event_attendance_list_reader.rb +8 -3
  54. data/lib/readers/group_export_list_reader.rb +8 -3
  55. data/lib/readers/group_invitation_list_reader.rb +8 -3
  56. data/lib/readers/group_list_reader.rb +6 -1
  57. data/lib/readers/group_role_list_reader.rb +8 -3
  58. data/lib/readers/group_tag_list_reader.rb +8 -3
  59. data/lib/readers/invitation_list_reader.rb +7 -2
  60. data/lib/readers/metric_list_reader.rb +7 -2
  61. data/lib/readers/metric_measurement_list_reader.rb +10 -3
  62. data/lib/readers/pledge_list_reader.rb +6 -1
  63. data/lib/readers/role_list_reader.rb +8 -3
  64. data/lib/readers/skill_list_reader.rb +7 -2
  65. data/lib/readers/skilled_user_id_list_reader.rb +10 -4
  66. data/lib/readers/skilled_user_list_reader.rb +10 -4
  67. data/lib/readers/tag_group_list_reader.rb +9 -4
  68. data/lib/readers/tag_list_reader.rb +7 -2
  69. data/lib/readers/terminology_list_reader.rb +7 -2
  70. data/lib/readers/user_address_list_reader.rb +8 -3
  71. data/lib/readers/user_admin_privilege_list_reader.rb +8 -3
  72. data/lib/readers/user_family_list_reader.rb +8 -2
  73. data/lib/readers/user_invitation_list_reader.rb +8 -3
  74. data/lib/readers/user_list_reader.rb +8 -6
  75. data/lib/readers/user_note_list_reader.rb +8 -3
  76. data/lib/readers/user_process_answer_list_reader.rb +9 -4
  77. data/lib/readers/user_process_list_reader.rb +8 -3
  78. data/lib/readers/user_reader.rb +1 -1
  79. data/lib/readers/user_role_list_reader.rb +8 -3
  80. data/lib/readers/user_skill_list_reader.rb +8 -3
  81. data/lib/readers/web_hook_list_reader.rb +7 -2
  82. data/thecity_admin_api.gemspec +1 -1
  83. metadata +7 -9
@@ -8,16 +8,21 @@ module TheCity
8
8
  # :: user_id is required
9
9
  # @param [CacheAdapter] cacher (optional) The cacher to be used to cache data.
10
10
  def initialize(options = {}, cacher = nil)
11
- page = options[:page] || 1
12
- user_id = options[:user_id]
11
+ options[:page] ||= 1
12
+ user_id = options.delete(:user_id)
13
13
  #@class_key = "users_#{user_id}_notes_#{page}"
14
14
  @url_data_path = "/users/#{user_id}/notes"
15
- @url_data_params = {:page => page}
15
+ @url_data_params = white_list_options(options)
16
16
 
17
17
  # The object to store and load the cache.
18
18
  @cacher = cacher unless cacher.nil?
19
19
  end
20
20
 
21
+ def white_list_options
22
+ white_list = [:page]
23
+ options.clone.delete_if { |key, value| !white_list.include?(key) }
24
+ end
25
+
21
26
  end
22
27
 
23
28
  end
@@ -8,17 +8,22 @@ module TheCity
8
8
  # :: user_id and process_id are required
9
9
  # @param [CacheAdapter] cacher (optional) The cacher to be used to cache data.
10
10
  def initialize(options = {}, cacher = nil)
11
- page = options[:page] || 1
12
- user_id = options[:user_id]
13
- process_id = options[:process_id]
11
+ options[:page] ||= 1
12
+ user_id = options.delete(:user_id)
13
+ process_id = options.delete(:process_id)
14
14
  #@class_key = "users_#{user_id}_processes_#{page}"
15
15
  @url_data_path = "/users/#{user_id}/processes/#{process_id}/answers"
16
- @url_data_params = {:page => page}
16
+ @url_data_params = white_list_options(options)
17
17
 
18
18
  # The object to store and load the cache.
19
19
  @cacher = cacher unless cacher.nil?
20
20
  end
21
21
 
22
+ def white_list_options
23
+ white_list = [:page]
24
+ options.clone.delete_if { |key, value| !white_list.include?(key) }
25
+ end
26
+
22
27
  end
23
28
 
24
29
  end
@@ -8,16 +8,21 @@ module TheCity
8
8
  # :: user_id is required
9
9
  # @param [CacheAdapter] cacher (optional) The cacher to be used to cache data.
10
10
  def initialize(options = {}, cacher = nil)
11
- page = options[:page] || 1
12
- user_id = options[:user_id]
11
+ options[:page] ||= 1
12
+ user_id = options.delete(:user_id)
13
13
  #@class_key = "users_#{user_id}_processes_#{page}"
14
14
  @url_data_path = "/users/#{user_id}/processes"
15
- @url_data_params = {:page => page}
15
+ @url_data_params = white_list_options(options)
16
16
 
17
17
  # The object to store and load the cache.
18
18
  @cacher = cacher unless cacher.nil?
19
19
  end
20
20
 
21
+ def white_list_options
22
+ white_list = [:page]
23
+ options.clone.delete_if { |key, value| !white_list.include?(key) }
24
+ end
25
+
21
26
  end
22
27
 
23
28
  end
@@ -11,7 +11,7 @@ module TheCity
11
11
  def initialize(user_id, options = {}, cacher = nil)
12
12
  #@class_key = "users_#{user_id}"
13
13
  @url_data_path = "/users/#{user_id}"
14
- @url_data_params = {:include_custom_fields => true}
14
+ @url_data_params = options
15
15
 
16
16
  # The object to store and load the cache.
17
17
  @cacher = cacher unless cacher.nil?
@@ -8,16 +8,21 @@ module TheCity
8
8
  # :: user_id is required
9
9
  # @param [CacheAdapter] cacher (optional) The cacher to be used to cache data.
10
10
  def initialize(options = {}, cacher = nil)
11
- page = options[:page] || 1
12
- user_id = options[:user_id]
11
+ options[:page] ||= 1
12
+ user_id = options.delete(:user_id)
13
13
  #@class_key = "users_#{user_id}_roles_#{page}"
14
14
  @url_data_path = "/users/#{user_id}/roles"
15
- @url_data_params = {:page => page}
15
+ @url_data_params = white_list_options(options)
16
16
 
17
17
  # The object to store and load the cache.
18
18
  @cacher = cacher unless cacher.nil?
19
19
  end
20
20
 
21
+ def white_list_options
22
+ white_list = [:page]
23
+ options.clone.delete_if { |key, value| !white_list.include?(key) }
24
+ end
25
+
21
26
  end
22
27
 
23
28
  end
@@ -8,16 +8,21 @@ module TheCity
8
8
  # :: user_id is required
9
9
  # @param [CacheAdapter] cacher (optional) The cacher to be used to cache data.
10
10
  def initialize(options = {}, cacher = nil)
11
- page = options[:page] || 1
12
- user_id = options[:user_id]
11
+ options[:page] ||= 1
12
+ user_id = options.delete(:user_id)
13
13
  #@class_key = "users_#{user_id}_skills_#{page}"
14
14
  @url_data_path = "/users/#{user_id}/skills"
15
- @url_data_params = {:page => page}
15
+ @url_data_params = white_list_options(options)
16
16
 
17
17
  # The object to store and load the cache.
18
18
  @cacher = cacher unless cacher.nil?
19
19
  end
20
20
 
21
+ def white_list_options
22
+ white_list = [:page]
23
+ options.clone.delete_if { |key, value| !white_list.include?(key) }
24
+ end
25
+
21
26
  end
22
27
 
23
28
  end
@@ -7,15 +7,20 @@ module TheCity
7
7
  # @param options A hash of options for requesting data from the server.
8
8
  # @param [CacheAdapter] cacher (optional) The cacher to be used to cache data.
9
9
  def initialize(options = {}, cacher = nil)
10
- page = options[:page] || 1
10
+ options[:page] ||= 1
11
11
  #@class_key = "web_hooks_#{page}"
12
12
  @url_data_path = "/webhooks"
13
- @url_data_params = {:page => page}
13
+ @url_data_params = white_list_options(options)
14
14
 
15
15
  # The object to store and load the cache.
16
16
  @cacher = cacher unless cacher.nil?
17
17
  end
18
18
 
19
+ def white_list_options
20
+ white_list = [:page]
21
+ options.clone.delete_if { |key, value| !white_list.include?(key) }
22
+ end
23
+
19
24
  end
20
25
 
21
26
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  PROJECT_GEM = 'the-city-admin'
3
- PROJECT_GEM_VERSION = '0.5.2'
3
+ PROJECT_GEM_VERSION = '0.6.0'
4
4
 
5
5
  s.name = PROJECT_GEM
6
6
  s.version = PROJECT_GEM_VERSION
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the-city-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
5
- prerelease:
4
+ version: 0.6.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Wes Hays
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-24 00:00:00.000000000 Z
11
+ date: 2013-06-24 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: typhoeus
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - '='
28
25
  - !ruby/object:Gem::Version
@@ -50,6 +47,7 @@ files:
50
47
  - examples/barcodes_checkins.rb
51
48
  - examples/city_keys.rb
52
49
  - examples/donation_export.rb
50
+ - examples/donations.rb
53
51
  - examples/familes.rb
54
52
  - examples/groups.rb
55
53
  - examples/metrics.rb
@@ -62,6 +60,7 @@ files:
62
60
  - examples/webhooks.rb
63
61
  - lib/api/address.rb
64
62
  - lib/api/address_list.rb
63
+ - lib/api/api_list.rb
65
64
  - lib/api/api_object.rb
66
65
  - lib/api/barcode.rb
67
66
  - lib/api/checkin.rb
@@ -323,27 +322,26 @@ files:
323
322
  - thecity_admin_api.gemspec
324
323
  homepage: https://github.com/thecity/thecity-admin-ruby
325
324
  licenses: []
325
+ metadata: {}
326
326
  post_install_message:
327
327
  rdoc_options: []
328
328
  require_paths:
329
329
  - lib
330
330
  required_ruby_version: !ruby/object:Gem::Requirement
331
- none: false
332
331
  requirements:
333
332
  - - ! '>='
334
333
  - !ruby/object:Gem::Version
335
334
  version: '0'
336
335
  required_rubygems_version: !ruby/object:Gem::Requirement
337
- none: false
338
336
  requirements:
339
337
  - - ! '>='
340
338
  - !ruby/object:Gem::Version
341
339
  version: '0'
342
340
  requirements: []
343
341
  rubyforge_project: Project on www.github.com
344
- rubygems_version: 1.8.25
342
+ rubygems_version: 2.0.3
345
343
  signing_key:
346
- specification_version: 3
344
+ specification_version: 4
347
345
  summary: Ruby gem/plugin to interact with The City Admin API (https://api.OnTheCity.org).
348
346
  test_files:
349
347
  - spec/api/address_list_spec.rb