Class: Quickbooks::Model::TimeActivity

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/quickbooks/model/time_activity.rb

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, #ensure_line_items_initialization, #initialize, inspect, #inspect, 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

Constructor Details

This class inherits a constructor from Quickbooks::Model::BaseModel

Instance Method Details

#valid_for_create?Boolean

Returns:

  • (Boolean)


44
45
46
47
# File 'lib/quickbooks/model/time_activity.rb', line 44

def valid_for_create?
  valid?
  errors.empty?
end

#valid_for_deletion?Boolean

Returns:

  • (Boolean)


49
50
51
52
# File 'lib/quickbooks/model/time_activity.rb', line 49

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

Returns:

  • (Boolean)


37
38
39
40
41
42
# File 'lib/quickbooks/model/time_activity.rb', line 37

def valid_for_update?
  if sync_token.nil?
    errors.add(:sync_token, "Missing required attribute SyncToken for update")
  end
  errors.empty?
end