Class: Quickeebooks::Online::Model::Invoice
- Inherits:
-
IntuitType
- Object
- IntuitType
- Quickeebooks::Online::Model::Invoice
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/quickeebooks/online/model/invoice.rb
Constant Summary collapse
- XML_NODE =
"Invoice"
- REST_RESOURCE =
"invoice"
Class Method Summary collapse
-
.resource_for_collection ⇒ Object
Class methods.
Instance Method Summary collapse
-
#initialize ⇒ Invoice
constructor
A new instance of Invoice.
- #to_xml_ns(options = {}) ⇒ Object
- #valid_for_deletion? ⇒ Boolean
- #valid_for_update? ⇒ Boolean
Methods inherited from IntuitType
Constructor Details
#initialize ⇒ Invoice
Returns a new instance of Invoice.
37 38 39 |
# File 'lib/quickeebooks/online/model/invoice.rb', line 37 def initialize ensure_line_items_initialization end |
Class Method Details
.resource_for_collection ⇒ Object
Class methods
55 56 57 |
# File 'lib/quickeebooks/online/model/invoice.rb', line 55 def self.resource_for_collection "#{self::REST_RESOURCE}s" end |
Instance Method Details
#to_xml_ns(options = {}) ⇒ Object
50 51 52 |
# File 'lib/quickeebooks/online/model/invoice.rb', line 50 def to_xml_ns( = {}) to_xml_inject_ns(XML_NODE, ) end |
#valid_for_deletion? ⇒ Boolean
45 46 47 48 |
# File 'lib/quickeebooks/online/model/invoice.rb', line 45 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
41 42 43 |
# File 'lib/quickeebooks/online/model/invoice.rb', line 41 def valid_for_update? errors.empty? end |