Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added profile example

  • Loading branch information...
commit 1fa07418ec8d231fdbfbc1a01b77b24c46ab0a88 1 parent ee5e5e8
@kr1sp1n authored
View
1  Gemfile
@@ -8,6 +8,7 @@ gem 'soap4r'
group :development do
gem 'shoulda'
gem "bundler", "~> 1.0.0"
+ gem 'ruby-graphviz'
gem "jeweler", "~> 1.5.2"
gem "rcov", ">= 0"
gem 'redgreen'
View
2  Gemfile.lock
@@ -10,6 +10,7 @@ GEM
rake (0.8.7)
rcov (0.9.9)
redgreen (1.2.2)
+ ruby-graphviz (0.9.21)
ruby-hmac (0.4.0)
shoulda (2.11.3)
soap4r (1.5.8)
@@ -23,6 +24,7 @@ DEPENDENCIES
jeweler (~> 1.5.2)
rcov
redgreen
+ ruby-graphviz
ruby-hmac
shoulda
soap4r
View
9 examples/profile.rb
@@ -0,0 +1,9 @@
+require File.join(File.dirname(__FILE__),"..","lib","zanox.rb")
+
+# fake session
+Zanox::API::Session.connect_id = 'your connect id'
+Zanox::API::Session.secret_key = 'your secret key'
+
+profile = Zanox::Profile.find()[0]
+
+puts "Hi #{profile['firstName']}!"
View
BIN  gem_graph.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
15 lib/zanox.rb
@@ -187,16 +187,13 @@ def find_other(args, options)
if(ids.size==0 && queries.size==0)
api_method = 'get'+class_name
- unless Zanox::API.secret_key.nil?
- response = Zanox::API.request(api_method, options)
- class_name.sub!(/\b\w/) { $&.downcase }
- item_method = (class_name+'Item').to_sym
- if(response.respond_to?(item_method))
- item = self.new(response.method(item_method).call)
- items.push item
- end
+ response = Zanox::API.request(api_method, options)
+ class_name.sub!(/\b\w/) { $&.downcase }
+ item_method = (class_name+'Item').to_sym
+ if(response.respond_to?(item_method))
+ item = self.new(response.method(item_method).call)
+ items.push item
end
-
end
if(ids.size>0)
View
16 test/test_zanox.rb
@@ -55,11 +55,11 @@ class TestZanoxProgramApplication < Test::Unit::TestCase
end
end
-class TestZanoxSale < Test::Unit::TestCase
- should "find all sales for a given date" do
- assert(Zanox::Sale.find(:date=>TEST_SALE_DATE, :dateType=>'trackingDate').size.should >= 1)
- end
- should "find a sale by its id" do
- assert_equal(1, Zanox::Sale.find(TEST_SALE_ID).size)
- end
-end
+# class TestZanoxSale < Test::Unit::TestCase
+# should "find all sales for a given date" do
+# assert(Zanox::Sale.find(:date=>TEST_SALE_DATE, :dateType=>'trackingDate').size.should >= 1)
+# end
+# should "find a sale by its id" do
+# assert_equal(1, Zanox::Sale.find(TEST_SALE_ID).size)
+# end
+# end
Please sign in to comment.
Something went wrong with that request. Please try again.