Class: Quickbooks::Model::TimeActivity
Constant Summary
collapse
- XML_COLLECTION_NODE =
"TimeActivity"
- XML_NODE =
"TimeActivity"
- REST_RESOURCE =
'timeactivity'
- NAMEOF_OPTIONS =
%w( Employee Vendor )
Instance Method Summary
collapse
Methods inherited from BaseModel
attribute_names, #attributes, attrs_with_types, #initialize, #inspect, inspect, reference_attrs, reference_setters, resource_for_collection, resource_for_singular, to_xml_big_decimal, #to_xml_inject_ns, #to_xml_ns
Methods included from Validator
#line_item_size
Instance Method Details
#existence_of_employee_ref ⇒ Object
47
48
49
50
51
|
# File 'lib/quickbooks/model/time_activity.rb', line 47
def existence_of_employee_ref
if employee_ref.nil? || (employee_ref && employee_ref.value == 0)
errors.add(:employee_ref, "VendorRef is required and must be a non-zero value.")
end
end
|
#existence_of_vendor_ref ⇒ Object
53
54
55
56
57
|
# File 'lib/quickbooks/model/time_activity.rb', line 53
def existence_of_vendor_ref
if vendor_ref.nil? || (vendor_ref && vendor_ref.value == 0)
errors.add(:vendor_ref, "VendorRef is required and must be a non-zero value.")
end
end
|
#valid_for_create? ⇒ Boolean
66
67
68
69
|
# File 'lib/quickbooks/model/time_activity.rb', line 66
def valid_for_create?
valid?
errors.empty?
end
|
#valid_for_deletion? ⇒ Boolean
71
72
73
74
|
# File 'lib/quickbooks/model/time_activity.rb', line 71
def valid_for_deletion?
return false if(id.nil? || sync_token.nil?)
id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
end
|
#valid_for_update? ⇒ Boolean
59
60
61
62
63
64
|
# File 'lib/quickbooks/model/time_activity.rb', line 59
def valid_for_update?
if sync_token.nil?
errors.add(:sync_token, "Missing required attribute SyncToken for update")
end
errors.empty?
end
|