Class: Gnucash::Customer
- Inherits:
-
Object
- Object
- Gnucash::Customer
- Includes:
- Support::LightInspect
- Defined in:
- lib/gnucash/customer.rb
Overview
Represent a GnuCash customer object.
Instance Attribute Summary collapse
-
#address ⇒ String
readonly
The address of the customer.
-
#guid ⇒ String
readonly
The GUID of the customer.
-
#id ⇒ String
readonly
The ID of the customer.
-
#name ⇒ String
readonly
The name of the customer (unqualified).
-
#shipping_address ⇒ String
readonly
The shipping address of the customer.
Instance Method Summary collapse
-
#attributes ⇒ Array<Symbol>
Attributes available for inspection.
-
#full_name ⇒ String
Return the fully qualified customer name.
-
#initialize(book, node) ⇒ Customer
constructor
Create an customer object.
Methods included from Support::LightInspect
Constructor Details
#initialize(book, node) ⇒ Customer
Create an customer object.
28 29 30 31 32 33 34 35 36 |
# File 'lib/gnucash/customer.rb', line 28 def initialize(book, node) @book = book @node = node @name = node.xpath('cust:name').text @id = node.xpath('cust:id').text @guid = node.xpath('cust:guid').text @address = node.xpath('cust:addr').text @shipping_address = node.xpath('cust:shipaddr').text end |
Instance Attribute Details
#address ⇒ String (readonly)
Returns The address of the customer.
19 20 21 |
# File 'lib/gnucash/customer.rb', line 19 def address @address end |
#guid ⇒ String (readonly)
Returns The GUID of the customer.
13 14 15 |
# File 'lib/gnucash/customer.rb', line 13 def guid @guid end |
#id ⇒ String (readonly)
Returns The ID of the customer.
16 17 18 |
# File 'lib/gnucash/customer.rb', line 16 def id @id end |
#name ⇒ String (readonly)
Returns The name of the customer (unqualified).
10 11 12 |
# File 'lib/gnucash/customer.rb', line 10 def name @name end |
#shipping_address ⇒ String (readonly)
Returns The shipping address of the customer.
22 23 24 |
# File 'lib/gnucash/customer.rb', line 22 def shipping_address @shipping_address end |
Instance Method Details
#attributes ⇒ Array<Symbol>
Attributes available for inspection
49 50 51 |
# File 'lib/gnucash/customer.rb', line 49 def attributes %i[id name guid address shipping_address] end |
#full_name ⇒ String
Return the fully qualified customer name.
41 42 43 |
# File 'lib/gnucash/customer.rb', line 41 def full_name name end |