Class: Quickeebooks::Windows::Model::Employee

Inherits:
IntuitType
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/quickeebooks/windows/model/employee.rb

Constant Summary collapse

XML_COLLECTION_NODE =
'Employees'
XML_NODE =
'Employee'
REST_RESOURCE =
"employee"

Instance Method Summary collapse

Methods included from Logging

#log

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_addressObject



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_charactersObject



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_addressObject



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

Returns:

  • (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