Sha256: 4d9b157744d50a4d0b6bbff3b7980bba5cc316ac7c1b6be9935fa32046fd577c

Contents?: true

Size: 1.23 KB

Versions: 16

Compression:

Stored size: 1.23 KB

Contents

# *******************************************
# This is a demo file to show usage.
#
# @package TheCity::Admin
# @authors Robbie Lieb <robbie@onthecity.org>, Wes Hays <wes@onthecity.org>
# ******************************************* 

require 'ruby-debug'
require File.dirname(__FILE__) + '/../lib/the_city_admin.rb'

require File.dirname(__FILE__) + '/city_keys.rb'
include CityKeys

TheCity::AdminApi.connect(KEY, TOKEN)


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

tag_list = TheCity::TagList.new
puts "Tags: #{tag_list.total_entries}"


puts "*******************"
tag = TheCity::Tag.new
tag.name = 'zProgrammer'

if tag.save
  puts "Tag SAVED"
else
  puts "FAILED TO SAVE TAG: #{tag.error_messages}"
end
puts "*******************"

tag_list = TheCity::TagList.new
puts "Tags: #{tag_list.total_entries}"

puts "*******************"
tag.name = 'zProgrammer 2'

if tag.save
  puts "Tag Updated"
else
  puts "FAILED TO SAVE TAG: #{tag.error_messages}"
end
puts "*******************"


puts "*******************"
if tag.delete
  puts "Tag Deleted"
else
  puts "FAILED TO DELETE TAG: #{tag.error_messages}"
end
puts "*******************"


tag_list = TheCity::TagList.new
puts "Tags: #{tag_list.total_entries}"


puts "####################################"

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
the-city-admin-0.7.1 examples/tags.rb
the-city-admin-0.7.0 examples/tags.rb
the-city-admin-0.6.9 examples/tags.rb
the-city-admin-0.6.8 examples/tags.rb
the-city-admin-0.6.7 examples/tags.rb
the-city-admin-0.6.6 examples/tags.rb
the-city-admin-0.6.5 examples/tags.rb
the-city-admin-0.6.4 examples/tags.rb
the-city-admin-0.6.3 examples/tags.rb
the-city-admin-0.6.2 examples/tags.rb
the-city-admin-0.6.1 examples/tags.rb
the-city-admin-0.6.0 examples/tags.rb
the-city-admin-0.5.2 examples/tags.rb
the-city-admin-0.5.1 examples/tags.rb
the-city-admin-0.5.0 examples/tags.rb
the-city-admin-0.4.0 examples/tags.rb