Permalink
Browse files

Added Address convenience assignment methods to Online Customer model.

  • Loading branch information...
1 parent bc1c82b commit 580eef860b6f2e10a52805da4c6b1e0f91390a34 @ruckus committed Mar 30, 2013
Showing with 18 additions and 1 deletion.
  1. +4 −0 HISTORY.md
  2. +13 −0 lib/quickeebooks/online/model/customer.rb
  3. +1 −1 lib/quickeebooks/version.rb
View
@@ -1,3 +1,7 @@
+## 0.1.5 (2013-03-30)
+
+* Added Address convenience assignment methods to Online Customer model.
+
## 0.1.4 (2013-03-24)
* Refactored `Filter` and separated the handling of `Date` and `DateTime`. Also refactored how operational XML is generated and removed hard-coded XML scattered in classes in favor of a centralized mechanism for generating generic XML.
@@ -23,6 +23,19 @@ class Customer < Quickeebooks::Online::Model::IntuitType
xml_accessor :custom_fields, :from => 'CustomField', :as => [Quickeebooks::Online::Model::CustomerCustomField]
xml_accessor :paymethod_method_id, :from => 'PaymentMethodId', :as => Quickeebooks::Online::Model::Id
+ def address=(address)
+ self.addresses ||= []
+ self.addresses << address
+ end
+
+ def billing_address
+ addresses.detect { |address| address.tag == "Billing" }
+ end
+
+ def shipping_address
+ addresses.detect { |address| address.tag == "Shipping" }
+ end
+
end
end
end
@@ -1,5 +1,5 @@
module Quickeebooks
- VERSION = "0.1.4"
+ VERSION = "0.1.5"
end

0 comments on commit 580eef8

Please sign in to comment.