ffmike-rshoeboxed 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -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
@@ -10,5 +10,5 @@ require 'rshoeboxed/list_proxy'
10
10
  require 'rshoeboxed/parse_error'
11
11
 
12
12
  module RShoeboxed
13
- VERSION = '0.1.0'
13
+ VERSION = '0.1.1'
14
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffmike-rshoeboxed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Curren