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.
- checksums.yaml +7 -0
- data/.rvmrc +1 -1
- data/examples/city_keys.rb +2 -2
- data/examples/donations.rb +33 -0
- data/lib/api/address_list.rb +4 -5
- data/lib/api/api_list.rb +50 -0
- data/lib/api/checkin_list.rb +4 -5
- data/lib/api/donation.rb +36 -18
- data/lib/api/donation_export_list.rb +4 -5
- data/lib/api/donation_list.rb +5 -7
- data/lib/api/fund_list.rb +5 -7
- data/lib/api/group_address_list.rb +4 -5
- data/lib/api/group_checkin_list.rb +4 -5
- data/lib/api/group_event_attendance_list.rb +4 -5
- data/lib/api/group_export.rb +1 -0
- data/lib/api/group_export_list.rb +4 -5
- data/lib/api/group_invitation_list.rb +4 -5
- data/lib/api/group_list.rb +5 -7
- data/lib/api/group_role_list.rb +4 -5
- data/lib/api/group_tag_list.rb +4 -5
- data/lib/api/invitation_list.rb +4 -5
- data/lib/api/metric_list.rb +5 -6
- data/lib/api/metric_measurement_list.rb +5 -6
- data/lib/api/pledge_list.rb +5 -7
- data/lib/api/role_list.rb +5 -6
- data/lib/api/skill_list.rb +5 -6
- data/lib/api/skilled_user_id_list.rb +5 -6
- data/lib/api/skilled_user_list.rb +5 -6
- data/lib/api/tag_group_list.rb +5 -6
- data/lib/api/tag_list.rb +5 -6
- data/lib/api/terminology_list.rb +5 -6
- data/lib/api/user.rb +24 -23
- data/lib/api/user_address.rb +17 -12
- data/lib/api/user_address_list.rb +4 -5
- data/lib/api/user_admin_privilege_list.rb +5 -6
- data/lib/api/user_family_list.rb +5 -4
- data/lib/api/user_invitation_list.rb +5 -6
- data/lib/api/user_list.rb +5 -6
- data/lib/api/user_note_list.rb +5 -6
- data/lib/api/user_process_answer_list.rb +5 -6
- data/lib/api/user_process_list.rb +5 -6
- data/lib/api/user_role_list.rb +5 -6
- data/lib/api/user_skill_list.rb +5 -6
- data/lib/api/web_hook_list.rb +5 -6
- data/lib/auto_load.rb +1 -0
- data/lib/readers/address_list_reader.rb +6 -2
- data/lib/readers/checkin_list_reader.rb +7 -2
- data/lib/readers/donation_export_list_reader.rb +7 -2
- data/lib/readers/donation_list_reader.rb +6 -1
- data/lib/readers/fund_list_reader.rb +6 -1
- data/lib/readers/group_address_list_reader.rb +8 -3
- data/lib/readers/group_checkin_list_reader.rb +8 -3
- data/lib/readers/group_event_attendance_list_reader.rb +8 -3
- data/lib/readers/group_export_list_reader.rb +8 -3
- data/lib/readers/group_invitation_list_reader.rb +8 -3
- data/lib/readers/group_list_reader.rb +6 -1
- data/lib/readers/group_role_list_reader.rb +8 -3
- data/lib/readers/group_tag_list_reader.rb +8 -3
- data/lib/readers/invitation_list_reader.rb +7 -2
- data/lib/readers/metric_list_reader.rb +7 -2
- data/lib/readers/metric_measurement_list_reader.rb +10 -3
- data/lib/readers/pledge_list_reader.rb +6 -1
- data/lib/readers/role_list_reader.rb +8 -3
- data/lib/readers/skill_list_reader.rb +7 -2
- data/lib/readers/skilled_user_id_list_reader.rb +10 -4
- data/lib/readers/skilled_user_list_reader.rb +10 -4
- data/lib/readers/tag_group_list_reader.rb +9 -4
- data/lib/readers/tag_list_reader.rb +7 -2
- data/lib/readers/terminology_list_reader.rb +7 -2
- data/lib/readers/user_address_list_reader.rb +8 -3
- data/lib/readers/user_admin_privilege_list_reader.rb +8 -3
- data/lib/readers/user_family_list_reader.rb +8 -2
- data/lib/readers/user_invitation_list_reader.rb +8 -3
- data/lib/readers/user_list_reader.rb +8 -6
- data/lib/readers/user_note_list_reader.rb +8 -3
- data/lib/readers/user_process_answer_list_reader.rb +9 -4
- data/lib/readers/user_process_list_reader.rb +8 -3
- data/lib/readers/user_reader.rb +1 -1
- data/lib/readers/user_role_list_reader.rb +8 -3
- data/lib/readers/user_skill_list_reader.rb +8 -3
- data/lib/readers/web_hook_list_reader.rb +7 -2
- data/thecity_admin_api.gemspec +1 -1
- metadata +7 -9
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9aedbac713fcae49330b49c38fecdf4aaa92b354
|
4
|
+
data.tar.gz: f444b6444d42e4aae42bbbf7e6969f0357faa9e3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 676155448c9e815bb08fc898124024dbb703b9692133418e63b8b3c48190a589bc60335f1fffa552cfb8c32876deaff6578da1c0f45846cf046e88ef01d49ac3
|
7
|
+
data.tar.gz: c92561c0a923239e26f1586ebd82054ce5573c0065a35bee269b1413d5c52ae534c0ce614312b9d2822d52a36be34d3878b2e2aa5eda451b7f688aa600f5df2b
|
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm ruby-1.9.2-p320@admin-api
|
1
|
+
rvm ruby-1.9.2-p320@admin-api --create
|
data/examples/city_keys.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
# *******************************************
|
2
|
+
# This is a demo file to show usage.
|
3
|
+
#
|
4
|
+
# @package TheCity::Admin
|
5
|
+
# @authors Robbie Lieb <robbie@onthecity.org>, Wes Hays <wes@onthecity.org>
|
6
|
+
# *******************************************
|
7
|
+
|
8
|
+
TCA_ENV = 'development'
|
9
|
+
THE_CITY_ADMIN_PATH = 'http://api.devthecity.org:9292'
|
10
|
+
key = '6910f0d2654c7704ceb3af054f52294db67b23ee'
|
11
|
+
token = '3eaf0b8b967dde78'
|
12
|
+
|
13
|
+
|
14
|
+
require 'ruby-debug'
|
15
|
+
require File.dirname(__FILE__) + '/../lib/the_city_admin.rb'
|
16
|
+
|
17
|
+
require File.dirname(__FILE__) + '/city_keys.rb'
|
18
|
+
include CityKeys
|
19
|
+
|
20
|
+
TheCity::AdminApi.connect(KEY, TOKEN)
|
21
|
+
|
22
|
+
|
23
|
+
de_list = TheCity::DonationList.new
|
24
|
+
de_list.each do |item|
|
25
|
+
puts "DonationExport: #{item.inspect}"
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
puts "------------------------------------"
|
30
|
+
|
31
|
+
puts "####################################"
|
32
|
+
|
33
|
+
|
data/lib/api/address_list.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class AddressList
|
3
|
+
class AddressList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -21,8 +19,9 @@ module TheCity
|
|
21
19
|
# AddressList.new({:page => 2})
|
22
20
|
#
|
23
21
|
def initialize(options = {})
|
24
|
-
|
25
|
-
@
|
22
|
+
@options = options
|
23
|
+
@options[:reader] = TheCity::AddressListReader.new(@options) if @options[:reader].nil?
|
24
|
+
@json_data = @options[:reader].load_feed
|
26
25
|
|
27
26
|
@total_entries = @json_data['total_entries']
|
28
27
|
@total_pages = @json_data['total_pages']
|
data/lib/api/api_list.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
module TheCity
|
2
|
+
|
3
|
+
# This class is the base class for all TheCity objects and is meant to be inherited.
|
4
|
+
#
|
5
|
+
class ApiList
|
6
|
+
|
7
|
+
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
+
|
9
|
+
def self.load(options = {})
|
10
|
+
self.new(options)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Checks if there is a next page.
|
14
|
+
#
|
15
|
+
# @return true for yes, false for no.
|
16
|
+
def next_page?
|
17
|
+
@current_page < @total_pages
|
18
|
+
end
|
19
|
+
|
20
|
+
# Gets the next page of results.
|
21
|
+
#
|
22
|
+
# @return [UserList] or nil if there are no more pages.
|
23
|
+
def next_page
|
24
|
+
return nil unless next_page?
|
25
|
+
self.class.new( @options.merge({:page => @options[:page]+1}) )
|
26
|
+
end
|
27
|
+
|
28
|
+
# Loads the next page of results and replaces self with the results.
|
29
|
+
#
|
30
|
+
# @return true on success or otherwise false.
|
31
|
+
def next_page!
|
32
|
+
return false unless next_page?
|
33
|
+
|
34
|
+
@options[:page] += 1
|
35
|
+
@options[:reader] = @options[:reader].class.new(@options)
|
36
|
+
@json_data = @options[:reader].load_feed
|
37
|
+
|
38
|
+
@total_entries = @json_data['total_entries']
|
39
|
+
@total_pages = @json_data['total_pages']
|
40
|
+
@per_page = @json_data['per_page']
|
41
|
+
@current_page = @json_data['current_page']
|
42
|
+
|
43
|
+
return true
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
|
data/lib/api/checkin_list.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class CheckinList
|
3
|
+
class CheckinList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -21,8 +19,9 @@ module TheCity
|
|
21
19
|
# CheckinList.new({:page => 2})
|
22
20
|
#
|
23
21
|
def initialize(options = {})
|
24
|
-
|
25
|
-
@
|
22
|
+
@options = options
|
23
|
+
@options[:reader] = TheCity::CheckinListReader.new(@options) if @options[:reader].nil?
|
24
|
+
@json_data = @options[:reader].load_feed
|
26
25
|
|
27
26
|
@total_entries = @json_data['total_entries']
|
28
27
|
@total_pages = @json_data['total_pages']
|
data/lib/api/donation.rb
CHANGED
@@ -1,25 +1,37 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
3
|
class Donation < ApiObject
|
4
|
-
tc_attr_accessor :
|
5
|
-
:
|
6
|
-
:
|
4
|
+
tc_attr_accessor :split_id,
|
5
|
+
:external_id,
|
6
|
+
:amount,
|
7
|
+
:id,
|
8
|
+
:date,
|
9
|
+
:note,
|
10
|
+
:instrument,
|
11
|
+
:state,
|
7
12
|
:batch_id,
|
8
|
-
:
|
9
|
-
:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
:user,
|
14
|
+
:fund
|
15
|
+
|
16
|
+
# tc_attr_accessor :id,
|
17
|
+
# :user_id,
|
18
|
+
# :fund_id,
|
19
|
+
# :batch_id,
|
20
|
+
# :amount,
|
21
|
+
# :instrument_type,
|
22
|
+
# :donation_state,
|
23
|
+
# :donation_date,
|
24
|
+
# :created_at,
|
25
|
+
# :updated_at,
|
26
|
+
# :fund_name,
|
27
|
+
# :primary_campus_id,
|
28
|
+
# :user_name,
|
29
|
+
# :user_type,
|
30
|
+
# :user_api_url,
|
31
|
+
# :user_is_member,
|
32
|
+
# :spouse_id,
|
33
|
+
# :spouse_name,
|
34
|
+
# :spouse_is_member
|
23
35
|
|
24
36
|
# Loads the donation by the specified ID.
|
25
37
|
#
|
@@ -44,6 +56,12 @@ module TheCity
|
|
44
56
|
end
|
45
57
|
end
|
46
58
|
|
59
|
+
# Convert amount to cents.
|
60
|
+
#
|
61
|
+
# @return Amount in cents.
|
62
|
+
def amount_cents
|
63
|
+
(self.amount.to_f * 100).round.to_i
|
64
|
+
end
|
47
65
|
end
|
48
66
|
|
49
67
|
end
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class DonationExportList
|
3
|
+
class DonationExportList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -22,8 +20,9 @@ module TheCity
|
|
22
20
|
# DonationExportList.new({:donation_id => 12345, :page => 2})
|
23
21
|
#
|
24
22
|
def initialize(options = {})
|
25
|
-
|
26
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:reader] = TheCity::DonationExportListReader.new(@options) if @options[:reader].nil?
|
25
|
+
@json_data = @options[:reader].load_feed
|
27
26
|
|
28
27
|
@total_entries = @json_data['total_entries']
|
29
28
|
@total_pages = @json_data['total_pages']
|
data/lib/api/donation_list.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class DonationList
|
3
|
+
class DonationList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
|
-
|
10
7
|
# Constructor.
|
11
8
|
#
|
12
9
|
# @param options A hash of options for loading the list.
|
@@ -23,9 +20,10 @@ module TheCity
|
|
23
20
|
# DonationList.new({:page => 2})
|
24
21
|
#
|
25
22
|
def initialize(options = {})
|
26
|
-
options
|
27
|
-
|
28
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:page] ||= 1
|
25
|
+
@options[:reader] = TheCity::DonationListReader.new(@options) if @options[:reader].nil?
|
26
|
+
@json_data = @options[:reader].load_feed
|
29
27
|
|
30
28
|
@total_entries = @json_data['total_entries']
|
31
29
|
@total_pages = @json_data['total_pages']
|
data/lib/api/fund_list.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class FundList
|
3
|
+
class FundList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
|
-
|
10
7
|
# Constructor.
|
11
8
|
#
|
12
9
|
# @param options A hash of options for loading the list.
|
@@ -23,9 +20,10 @@ module TheCity
|
|
23
20
|
# FundList.new({:page => 2})
|
24
21
|
#
|
25
22
|
def initialize(options = {})
|
26
|
-
options
|
27
|
-
|
28
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:page] ||= 1
|
25
|
+
@options[:reader] = TheCity::FundListReader.new(@options) if @options[:reader].nil?
|
26
|
+
@json_data = @options[:reader].load_feed
|
29
27
|
|
30
28
|
@total_entries = @json_data['total_entries']
|
31
29
|
@total_pages = @json_data['total_pages']
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class GroupAddressList
|
3
|
+
class GroupAddressList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -22,8 +20,9 @@ module TheCity
|
|
22
20
|
# GroupAddressList.new({:group_id => 12345, :page => 2})
|
23
21
|
#
|
24
22
|
def initialize(options = {})
|
25
|
-
|
26
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:reader] = TheCity::GroupAddressListReader.new(@options) if @options[:reader].nil?
|
25
|
+
@json_data = @options[:reader].load_feed
|
27
26
|
|
28
27
|
@total_entries = @json_data['total_entries']
|
29
28
|
@total_pages = @json_data['total_pages']
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class GroupCheckinList
|
3
|
+
class GroupCheckinList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -22,8 +20,9 @@ module TheCity
|
|
22
20
|
# GroupCheckinList.new({:group_id => 12345, :page => 2})
|
23
21
|
#
|
24
22
|
def initialize(options = {})
|
25
|
-
|
26
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:reader] = TheCity::GroupCheckinListReader.new(@options) if @options[:reader].nil?
|
25
|
+
@json_data = @options[:reader].load_feed
|
27
26
|
|
28
27
|
@total_entries = @json_data['total_entries']
|
29
28
|
@total_pages = @json_data['total_pages']
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class GroupEventAttendanceList
|
3
|
+
class GroupEventAttendanceList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -22,8 +20,9 @@ module TheCity
|
|
22
20
|
# GroupEventAttendanceList.new({:group_id => 12345, :page => 2})
|
23
21
|
#
|
24
22
|
def initialize(options = {})
|
25
|
-
|
26
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:reader] = TheCity::GroupEventAttendanceListReader.new(@options) if @options[:reader].nil?
|
25
|
+
@json_data = @options[:reader].load_feed
|
27
26
|
|
28
27
|
@total_entries = @json_data['total_entries']
|
29
28
|
@total_pages = @json_data['total_pages']
|
data/lib/api/group_export.rb
CHANGED
@@ -15,6 +15,7 @@ module TheCity
|
|
15
15
|
# @param group_export_id The ID of the group export to load.
|
16
16
|
# @param options A hash of options for requesting data from the server.
|
17
17
|
# :: group_id is required
|
18
|
+
# :: user_type is optional. It can be "Users" or "OfflineUsers"
|
18
19
|
#
|
19
20
|
# Returns a new {GroupExport} object.
|
20
21
|
def self.load_by_id(group_export_id, options = {})
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class GroupExportList
|
3
|
+
class GroupExportList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -22,8 +20,9 @@ module TheCity
|
|
22
20
|
# GroupExportList.new({:group_id => 12345, :page => 2})
|
23
21
|
#
|
24
22
|
def initialize(options = {})
|
25
|
-
|
26
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:reader] = TheCity::GroupExportListReader.new(@options) if @options[:reader].nil?
|
25
|
+
@json_data = @options[:reader].load_feed
|
27
26
|
|
28
27
|
@total_entries = @json_data['total_entries']
|
29
28
|
@total_pages = @json_data['total_pages']
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class GroupInvitationList
|
3
|
+
class GroupInvitationList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -22,8 +20,9 @@ module TheCity
|
|
22
20
|
# GroupInvitationList.new({:group_id => 12345, :page => 2})
|
23
21
|
#
|
24
22
|
def initialize(options = {})
|
25
|
-
|
26
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:reader] = TheCity::GroupInvitationListReader.new(@options) if @options[:reader].nil?
|
25
|
+
@json_data = @options[:reader].load_feed
|
27
26
|
|
28
27
|
@total_entries = @json_data['total_entries']
|
29
28
|
@total_pages = @json_data['total_pages']
|
data/lib/api/group_list.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class GroupList
|
3
|
+
class GroupList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
|
-
|
10
7
|
# Constructor.
|
11
8
|
#
|
12
9
|
# @param options A hash of options for loading the list.
|
@@ -23,9 +20,10 @@ module TheCity
|
|
23
20
|
# UserList.new({:page => 2})
|
24
21
|
#
|
25
22
|
def initialize(options = {})
|
26
|
-
options
|
27
|
-
|
28
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:page] ||= 1
|
25
|
+
@options[:reader] = TheCity::GroupListReader.new(@options) if @options[:reader].nil?
|
26
|
+
@json_data = @options[:reader].load_feed
|
29
27
|
|
30
28
|
@total_entries = @json_data['total_entries']
|
31
29
|
@total_pages = @json_data['total_pages']
|
data/lib/api/group_role_list.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class GroupRoleList
|
3
|
+
class GroupRoleList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -22,8 +20,9 @@ module TheCity
|
|
22
20
|
# GroupRoleList.new({:group_id => 12345, :page => 2})
|
23
21
|
#
|
24
22
|
def initialize(options = {})
|
25
|
-
|
26
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:reader] = TheCity::GroupRoleListReader.new(@options) if @options[:reader].nil?
|
25
|
+
@json_data = @options[:reader].load_feed
|
27
26
|
|
28
27
|
@total_entries = @json_data['total_entries']
|
29
28
|
@total_pages = @json_data['total_pages']
|
data/lib/api/group_tag_list.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class GroupTagList
|
3
|
+
class GroupTagList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -22,8 +20,9 @@ module TheCity
|
|
22
20
|
# GroupTagList.new({:group_id => 12345, :page => 2})
|
23
21
|
#
|
24
22
|
def initialize(options = {})
|
25
|
-
|
26
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:reader] = TheCity::GroupTagListReader.new(@options) if @options[:reader].nil?
|
25
|
+
@json_data = @options[:reader].load_feed
|
27
26
|
|
28
27
|
@total_entries = @json_data['total_entries']
|
29
28
|
@total_pages = @json_data['total_pages']
|
data/lib/api/invitation_list.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class InvitationList
|
3
|
+
class InvitationList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -22,8 +20,9 @@ module TheCity
|
|
22
20
|
# InvitationList.new({:group_id => 12345, :page => 2})
|
23
21
|
#
|
24
22
|
def initialize(options = {})
|
25
|
-
|
26
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:reader] = TheCity::InvitationListReader.new(@options) if @options[:reader].nil?
|
25
|
+
@json_data = @options[:reader].load_feed
|
27
26
|
|
28
27
|
@total_entries = @json_data['total_entries']
|
29
28
|
@total_pages = @json_data['total_pages']
|
data/lib/api/metric_list.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class MetricList
|
3
|
+
class MetricList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of filters for loading the list.
|
@@ -31,9 +29,10 @@ module TheCity
|
|
31
29
|
# MetricList.new({:page => 2, :filter => :contact_updated_in_the_last_2_weeks})
|
32
30
|
#
|
33
31
|
def initialize(options = {})
|
34
|
-
options
|
35
|
-
|
36
|
-
@
|
32
|
+
@options = options
|
33
|
+
@options[:page] ||= 1
|
34
|
+
@options[:reader] = TheCity::MetricListReader.new(@options) if @options[:reader].nil?
|
35
|
+
@json_data = @options[:reader].load_feed
|
37
36
|
|
38
37
|
@total_entries = @json_data['total_entries']
|
39
38
|
@total_pages = @json_data['total_pages']
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class MetricMeasurementList
|
3
|
+
class MetricMeasurementList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the list.
|
@@ -21,9 +19,10 @@ module TheCity
|
|
21
19
|
# MetricMeasurementList.new({:group_id => 12345, :page => 2})
|
22
20
|
#
|
23
21
|
def initialize(options = {})
|
24
|
-
options
|
25
|
-
|
26
|
-
@
|
22
|
+
@options = options
|
23
|
+
@options[:page] ||= 1
|
24
|
+
@options[:reader] = TheCity::MetricMeasurementListReader.new(@options) if @options[:reader].nil?
|
25
|
+
@json_data = @options[:reader].load_feed
|
27
26
|
|
28
27
|
@total_entries = @json_data['total_entries']
|
29
28
|
@total_pages = @json_data['total_pages']
|
data/lib/api/pledge_list.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class PledgeList
|
3
|
+
class PledgeList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
|
-
|
10
7
|
# Constructor.
|
11
8
|
#
|
12
9
|
# @param options A hash of options for loading the list.
|
@@ -23,9 +20,10 @@ module TheCity
|
|
23
20
|
# PledgeList.new({:page => 2})
|
24
21
|
#
|
25
22
|
def initialize(options = {})
|
26
|
-
options
|
27
|
-
|
28
|
-
@
|
23
|
+
@options = options
|
24
|
+
@options[:page] ||= 1
|
25
|
+
@options[:reader] = TheCity::PledgeListReader.new(@options) if @options[:reader].nil?
|
26
|
+
@json_data = @options[:reader].load_feed
|
29
27
|
|
30
28
|
@total_entries = @json_data['total_entries']
|
31
29
|
@total_pages = @json_data['total_pages']
|
data/lib/api/role_list.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
module TheCity
|
2
2
|
|
3
|
-
class RoleList
|
3
|
+
class RoleList < ApiList
|
4
4
|
|
5
5
|
include Enumerable
|
6
6
|
|
7
|
-
attr_reader :total_entries, :total_pages, :per_page, :current_page
|
8
|
-
|
9
7
|
# Constructor.
|
10
8
|
#
|
11
9
|
# @param options A hash of options for loading the skill list.
|
@@ -21,9 +19,10 @@ module TheCity
|
|
21
19
|
# RoleList.new(reader, {:page => 2})
|
22
20
|
#
|
23
21
|
def initialize(options = {})
|
24
|
-
options
|
25
|
-
|
26
|
-
@
|
22
|
+
@options = options
|
23
|
+
@options[:page] ||= 1
|
24
|
+
@options[:reader] = TheCity::RoleListReader.new(@options) if @options[:reader].nil?
|
25
|
+
@json_data = @options[:reader].load_feed
|
27
26
|
|
28
27
|
@total_entries = @json_data['total_entries']
|
29
28
|
@total_pages = @json_data['total_pages']
|