ffmike-rshoeboxed 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +11 -0
- data/lib/rshoeboxed/business_card.rb +5 -0
- data/lib/rshoeboxed/receipt.rb +5 -0
- data/lib/rshoeboxed.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -28,6 +28,12 @@ to the return_url with the user_token.
|
|
28
28
|
connection = RShoeboxed::Connection.new("api_token", "user_token")
|
29
29
|
receipts = connection.get_receipt_call(Date.new(2008, 1, 1), Date.new(2008, 12, 29))
|
30
30
|
|
31
|
+
=== Get the total number of available receipts
|
32
|
+
|
33
|
+
connection = RShoeboxed::Connection.new("api_token", "user_token")
|
34
|
+
receipts = connection.get_receipt_call(Date.new(2008, 1, 1), Date.new(2008, 12, 29))
|
35
|
+
available_receipts = RShoeboxed::Receipt.available_count
|
36
|
+
|
31
37
|
=== Get a particular receipt
|
32
38
|
|
33
39
|
connection = RShoeboxed::Connection.new("api_token", "user_token")
|
@@ -43,6 +49,11 @@ to the return_url with the user_token.
|
|
43
49
|
connection = RShoeboxed::Connection.new("api_token", "user_token")
|
44
50
|
cards = connection.get_business_card_call(200,1)
|
45
51
|
|
52
|
+
=== Get the total number of available business cards
|
53
|
+
|
54
|
+
connection = RShoeboxed::Connection.new("api_token", "user_token")
|
55
|
+
cards = connection.get_business_card_call(200,1)
|
56
|
+
available_business_cards = RShoeboxed::BusinessCard.available_count
|
46
57
|
|
47
58
|
== INSTALL:
|
48
59
|
|
@@ -3,6 +3,10 @@ require 'rexml/document'
|
|
3
3
|
|
4
4
|
module RShoeboxed
|
5
5
|
class BusinessCard
|
6
|
+
@@available_count = 0
|
7
|
+
def self.available_count
|
8
|
+
@@available_count
|
9
|
+
end
|
6
10
|
attr_accessor :id , :first_name,:last_name,:address,:address_2,
|
7
11
|
:city,:state,:zip,:country,:email,:website,
|
8
12
|
:company,:position,:work_phone,:cell_phone,:fax,
|
@@ -10,6 +14,7 @@ module RShoeboxed
|
|
10
14
|
|
11
15
|
def self.parse(xml)
|
12
16
|
document = REXML::Document.new(xml)
|
17
|
+
@@available_count = document.elements["GetBusinessCardCallResponse"].elements["BusinessCards"].attributes["count"].to_i
|
13
18
|
document.elements.collect("//BusinessCard") do |card_element|
|
14
19
|
card = BusinessCard.new
|
15
20
|
begin
|
data/lib/rshoeboxed/receipt.rb
CHANGED
@@ -4,11 +4,16 @@ require 'rexml/document'
|
|
4
4
|
|
5
5
|
module RShoeboxed
|
6
6
|
class Receipt
|
7
|
+
@@available_count = 0
|
8
|
+
def self.available_count
|
9
|
+
@@available_count
|
10
|
+
end
|
7
11
|
attr_accessor :id, :store, :image_url, :categories
|
8
12
|
attr_reader :sell_date, :created_date, :modified_date, :total
|
9
13
|
|
10
14
|
def self.parse(xml)
|
11
15
|
document = REXML::Document.new(xml)
|
16
|
+
@@available_count = document.elements["GetReceiptCallResponse"].elements["Receipts"].attributes["count"].to_i
|
12
17
|
document.elements.collect("//Receipt") do |receipt_element|
|
13
18
|
receipt = Receipt.new
|
14
19
|
begin
|
data/lib/rshoeboxed.rb
CHANGED