Class: Quickeebooks::Windows::Model::Employee
- Inherits:
-
IntuitType
- Object
- IntuitType
- Quickeebooks::Windows::Model::Employee
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/quickeebooks/windows/model/employee.rb
Constant Summary collapse
- XML_COLLECTION_NODE =
'Employees'
- XML_NODE =
'Employee'
- REST_RESOURCE =
services.intuit.com/sb/employee/v2/<realmID>
"employee"
Instance Method Summary collapse
- #address=(address) ⇒ Object
- #billing_address ⇒ Object
- #name_cannot_contain_invalid_characters ⇒ Object
- #shipping_address ⇒ Object
- #valid_for_create? ⇒ Boolean
Methods included from Logging
Instance Method Details
#address=(address) ⇒ Object
72 73 74 75 |
# File 'lib/quickeebooks/windows/model/employee.rb', line 72 def address=(address) self.addresses ||= [] self.addresses << address end |
#billing_address ⇒ Object
77 78 79 |
# File 'lib/quickeebooks/windows/model/employee.rb', line 77 def billing_address addresses.detect { |address| address.tag == "Billing" } end |
#name_cannot_contain_invalid_characters ⇒ Object
66 67 68 69 70 |
# File 'lib/quickeebooks/windows/model/employee.rb', line 66 def name_cannot_contain_invalid_characters if name.to_s.index(':') errors.add(:name, "Name cannot contain a colon (:)") end end |
#shipping_address ⇒ Object
81 82 83 |
# File 'lib/quickeebooks/windows/model/employee.rb', line 81 def shipping_address addresses.detect { |address| address.tag == "Shipping" } end |
#valid_for_create? ⇒ Boolean
58 59 60 61 62 63 64 |
# File 'lib/quickeebooks/windows/model/employee.rb', line 58 def valid_for_create? valid? if type_of.nil? errors.add(:type_of, "Missing required attribute TypeOf for Create") end errors.empty? end |