Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed module name #9

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Add your church's City API Token and API Key to [RAILS_ROOT]/config/initializers

Next you will need to initialize a connection

TheCity::AdminApi.connect(THECITY_KEY, THECITY_TOKEN)
TheCityAdmin::AdminApi.connect(THECITY_KEY, THECITY_TOKEN)



Expand Down
8 changes: 4 additions & 4 deletions examples/addresses.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# *******************************************
# This is a demo file to show usage.
#
# @package TheCity::Admin
# @package TheCityAdmin::Admin
# @authors Robbie Lieb <robbie@onthecity.org>, Wes Hays <wes@onthecity.org>
# *******************************************

Expand All @@ -11,12 +11,12 @@
require File.dirname(__FILE__) + '/city_keys.rb'
include CityKeys

TheCity::AdminApi.connect(KEY, TOKEN)
TheCityAdmin::AdminApi.connect(KEY, TOKEN)


puts "------------------------------------"

address_list = TheCity::AddressList.new
address_list = TheCityAdmin::AddressList.new
if address_list.empty?
puts "No addresses in list"
else
Expand All @@ -25,7 +25,7 @@

address = address_list[0]

address2 = TheCity::Address.load_by_id(address.id)
address2 = TheCityAdmin::Address.load_by_id(address.id)

if address2.street == address.street
puts "Address found (#{address.street})"
Expand Down
10 changes: 5 additions & 5 deletions examples/barcodes_checkins.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# *******************************************
# This is a demo file to show usage.
#
# @package TheCity::Admin
# @package TheCityAdmin::Admin
# @authors Robbie Lieb <robbie@onthecity.org>, Wes Hays <wes@onthecity.org>
# *******************************************

Expand All @@ -11,12 +11,12 @@
require File.dirname(__FILE__) + '/city_keys.rb'
include CityKeys

TheCity::AdminApi.connect(KEY, TOKEN)
TheCityAdmin::AdminApi.connect(KEY, TOKEN)


puts "------------------------------------"

barcode = TheCity::Barcode.load_by_id(12345)
barcode = TheCityAdmin::Barcode.load_by_id(12345)
if barcode.nil?
puts 'Barcode not found'
else
Expand All @@ -26,7 +26,7 @@

puts "------------------------------------"

checkin_list = TheCity::CheckinList.new
checkin_list = TheCityAdmin::CheckinList.new
# if checkin_list.empty?
# puts "No checkins in list"
# else
Expand All @@ -35,7 +35,7 @@

# checkin = checkin_list[0]

# checkin2 = TheCity::Checkin.load_by_id(checkin.id)
# checkin2 = TheCityAdmin::Checkin.load_by_id(checkin.id)
# if checkin2.nil?
# puts 'Checkin not found'
# else
Expand Down
14 changes: 7 additions & 7 deletions examples/donation_export.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# *******************************************
# This is a demo file to show usage.
#
# @package TheCity::Admin
# @package TheCityAdmin::Admin
# @authors Robbie Lieb <robbie@onthecity.org>, Wes Hays <wes@onthecity.org>
# *******************************************

Expand All @@ -11,15 +11,15 @@
require File.dirname(__FILE__) + '/city_keys.rb'
include CityKeys

TheCity::AdminApi.connect(KEY, TOKEN)
TheCityAdmin::AdminApi.connect(KEY, TOKEN)


de_list = TheCity::DonationExportList.new
de_list = TheCityAdmin::DonationExportList.new
de_list.each do |item|
puts "DonationExport: #{item.inspect}"
end

# de_list = TheCity::DonationExportList.new
# de_list = TheCityAdmin::DonationExportList.new
# de_list.each do |item|
# if item.delete
# puts "DonationExport #{item.id} deleted"
Expand All @@ -28,22 +28,22 @@
# end
# end

# de_list = TheCity::DonationExportList.new
# de_list = TheCityAdmin::DonationExportList.new
# if de_list.empty?
# puts "No donation exports found"
# else
# puts "Donation exports found"
# end

# donation_export = TheCity::DonationExport.new
# donation_export = TheCityAdmin::DonationExport.new
# if donation_export.save
# puts "Donation export created"
# else
# puts "Failed to create donation export"
# end


# de_list = TheCity::DonationExportList.new
# de_list = TheCityAdmin::DonationExportList.new
# if de_list.empty?
# puts "No donation exports found"
# else
Expand Down
6 changes: 3 additions & 3 deletions examples/donations.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# *******************************************
# This is a demo file to show usage.
#
# @package TheCity::Admin
# @package TheCityAdmin::Admin
# @authors Robbie Lieb <robbie@onthecity.org>, Wes Hays <wes@onthecity.org>
# *******************************************

Expand All @@ -11,10 +11,10 @@
require File.dirname(__FILE__) + '/city_keys.rb'
include CityKeys

TheCity::AdminApi.connect(KEY, TOKEN)
TheCityAdmin::AdminApi.connect(KEY, TOKEN)


de_list = TheCity::DonationList.new
de_list = TheCityAdmin::DonationList.new
de_list.each do |item|
puts "DonationExport: #{item.inspect}"
end
Expand Down
18 changes: 9 additions & 9 deletions examples/familes.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# *******************************************
# This is a demo file to show usage.
#
# @package TheCity::Admin
# @package TheCityAdmin::Admin
# @authors Robbie Lieb <robbie@onthecity.org>, Wes Hays <wes@onthecity.org>
# *******************************************

Expand All @@ -11,34 +11,34 @@
require File.dirname(__FILE__) + '/city_keys.rb'
include CityKeys

TheCity::AdminApi.connect(KEY, TOKEN)
TheCityAdmin::AdminApi.connect(KEY, TOKEN)


puts "------------------------------------"

user_list = TheCity::UserList.new
user_list = TheCityAdmin::UserList.new
user1 = user_list[0]
# user2 = user_list[1]

family = TheCity::Family.new
family = TheCityAdmin::Family.new
family.external_id = 'family123'

member1 = TheCity::FamilyMember.new
member1 = TheCityAdmin::FamilyMember.new
member1.user_id = user1.id
member1.name = user1.full_name
member1.email = user1.email
member1.external_id_1 = 'weshays123'
member1.birthdate = user1.birthdate
member1.family_role = TheCity::FamilyMember::Roles[:spouse]
member1.family_role = TheCityAdmin::FamilyMember::Roles[:spouse]
family.add_family_member(member1)

# member2 = TheCity::FamilyMember.new
# member2 = TheCityAdmin::FamilyMember.new
# member2.user_id = user2.id
# member2.name = user2.full_name
# member2.email = user2.email
# member2.external_id_1 = 'annahays123'
# member2.birthdate = user1.birthdate
# member2.family_role = TheCity::FamilyMember::Roles[:spouse]
# member2.family_role = TheCityAdmin::FamilyMember::Roles[:spouse]
# family.add_family_member(member2)

if family.save
Expand All @@ -49,7 +49,7 @@
end


#family2 = TheCity::Family.load_by_id(398768686)
#family2 = TheCityAdmin::Family.load_by_id(398768686)

# if family.nil?
# puts "Family found with #{family.members.size} members"
Expand Down
8 changes: 4 additions & 4 deletions examples/groups.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# *******************************************
# This is a demo file to show usage.
#
# @package TheCity::Admin
# @package TheCityAdmin::Admin
# @authors Robbie Lieb <robbie@onthecity.org>, Wes Hays <wes@onthecity.org>
# *******************************************

Expand All @@ -11,9 +11,9 @@
require File.dirname(__FILE__) + '/city_keys.rb'
include CityKeys

TheCity::AdminApi.connect(KEY, TOKEN)
TheCityAdmin::AdminApi.connect(KEY, TOKEN)

group_list = TheCity::GroupList.new
group_list = TheCityAdmin::GroupList.new

group = group_list.first
puts group.name
Expand All @@ -26,7 +26,7 @@
puts "Addresses: #{group.addresses.size}"
end

address = TheCity::GroupAddress.new
address = TheCityAdmin::GroupAddress.new
address.group_id = group.id
address.location_type = 'Work'
address.street = '445 S. Virginia St'
Expand Down
10 changes: 5 additions & 5 deletions examples/measurements.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# *******************************************
# This is a demo file to show usage.
#
# @package TheCity::Admin
# @package TheCityAdmin::Admin
# @authors Robbie Lieb <robbie@onthecity.org>, Wes Hays <wes@onthecity.org>
# *******************************************

Expand All @@ -11,20 +11,20 @@
require File.dirname(__FILE__) + '/city_keys.rb'
include CityKeys

TheCity::AdminApi.connect(KEY, TOKEN)
TheCityAdmin::AdminApi.connect(KEY, TOKEN)


puts "------------------------------------"

metric_list = TheCity::MetricList.new
metric_list = TheCityAdmin::MetricList.new
if metric_list.empty?
puts "No metrics in list"
else
puts "Metrices: #{metric_list.count}"
end


# The next line is the same as: TheCity::MetricMeasurementList.new({:metric_id => metric_list[0].id})
# The next line is the same as: TheCityAdmin::MetricMeasurementList.new({:metric_id => metric_list[0].id})
measurement_list = metric_list[0].measurements
if metric_list.empty?
puts "No measurements in list"
Expand All @@ -33,7 +33,7 @@
end


# The next line is the same as: TheCity::MetricMeasurementValues.new({:metric_id => metric_list[0].id})
# The next line is the same as: TheCityAdmin::MetricMeasurementValues.new({:metric_id => metric_list[0].id})
values = metric_list[0].measurement_values
if values.empty?
puts "No values returned"
Expand Down
14 changes: 7 additions & 7 deletions examples/metrics.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# *******************************************
# This is a demo file to show usage.
#
# @package TheCity::Admin
# @package TheCityAdmin::Admin
# @authors Robbie Lieb <robbie@onthecity.org>, Wes Hays <wes@onthecity.org>
# *******************************************

Expand All @@ -11,20 +11,20 @@
require File.dirname(__FILE__) + '/city_keys.rb'
include CityKeys

TheCity::AdminApi.connect(KEY, TOKEN)
TheCityAdmin::AdminApi.connect(KEY, TOKEN)


puts "------------------------------------"

metric_list = TheCity::MetricList.new
metric_list = TheCityAdmin::MetricList.new
if metric_list.empty?
puts "No metrics in list"
else
puts "Metrices: #{metric_list.count}"
end


metric = TheCity::Metric.new
metric = TheCityAdmin::Metric.new
metric.name = "CoolThing#{Time.now.to_i}"
if metric.save
puts "Metric created (#{metric.id})"
Expand All @@ -33,14 +33,14 @@
end


metric_list2 = TheCity::MetricList.new
metric_list2 = TheCityAdmin::MetricList.new
if metric_list2.empty?
puts "No metrics in list"
else
puts "Metrics: #{metric_list2.count}"
end

metric2 = TheCity::Metric.load_by_id(metric.id)
metric2 = TheCityAdmin::Metric.load_by_id(metric.id)
if metric2.nil?
puts "Metric not found"
else
Expand All @@ -62,7 +62,7 @@
puts "Unable to delete metric #{metric2.id}: #{metric2.error_messages.join(', ')}"
end

metric_list3 = TheCity::MetricList.new
metric_list3 = TheCityAdmin::MetricList.new
if metric_list3.empty?
puts "No metrics in list"
else
Expand Down
Loading