From aa3b65d1e2bd2bb0352bdf19e7a91fc95422365b Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 31 Aug 2013 16:34:42 -0400 Subject: [PATCH] store account description --- lib/gnucash/account.rb | 4 ++++ spec/gnucash/account_spec.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/gnucash/account.rb b/lib/gnucash/account.rb index bb6f06b..b52179b 100644 --- a/lib/gnucash/account.rb +++ b/lib/gnucash/account.rb @@ -4,6 +4,9 @@ module Gnucash # _String_: The name of the account (unqualified) attr_reader :name + # _String_: The account description + attr_reader :description + # _String_: The account type (such as "EXPENSE") attr_reader :type @@ -26,6 +29,7 @@ module Gnucash @node = node @name = node.xpath('act:name').text @type = node.xpath('act:type').text + @description = node.xpath('act:description').text @id = node.xpath('act:id').text @parent_id = node.xpath('act:parent').text @parent_id = nil if @parent_id == "" diff --git a/spec/gnucash/account_spec.rb b/spec/gnucash/account_spec.rb index c13e10b..4ca3dbe 100644 --- a/spec/gnucash/account_spec.rb +++ b/spec/gnucash/account_spec.rb @@ -13,6 +13,10 @@ module Gnucash @salary.name.should == "Salary" end + it "gives access to the account description" do + @checking.description.should == "Checking Account" + end + it "gives access to the fully-qualified account name" do @checking.full_name.should == "Assets::Current Assets::Checking Account" end