Class: Nfe::Resources::ConsumerInvoicePending
- Inherits:
-
Data
- Object
- Data
- Nfe::Resources::ConsumerInvoicePending
- Defined in:
- lib/nfe/resources/responses/consumer_invoice_pending.rb,
sig/nfe/resources/consumer_invoice_pending.rbs
Overview
Discriminated result of an asynchronous NFC-e emission (HTTP 202): the
API accepted the request and is processing it; the document is not yet
materialized. invoice_id is parsed from the Location header's final
path segment and location is the raw header value.
Discriminate against ConsumerInvoiceIssued with the +pending?+/+issued?+ predicates or +case+/+in+ pattern matching, then poll FlowStatus.terminal? until the invoice settles.
Instance Attribute Summary collapse
-
#invoice_id ⇒ String?
readonly
Returns the value of attribute invoice_id.
-
#location ⇒ String?
readonly
Returns the value of attribute location.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ConsumerInvoicePending
constructor
A new instance of ConsumerInvoicePending.
-
#issued? ⇒ Boolean
Always
falsefor a pending result. -
#pending? ⇒ Boolean
Always
truefor a pending result.
Constructor Details
#initialize(invoice_id:, location:) ⇒ void #initialize(invoice_id, location) ⇒ void
Returns a new instance of ConsumerInvoicePending.
10 11 |
# File 'sig/nfe/resources/consumer_invoice_pending.rbs', line 10
def initialize: (invoice_id: String?, location: String?) -> void
| (String? invoice_id, String? location) -> void
|
Instance Attribute Details
#invoice_id ⇒ String? (readonly)
Returns the value of attribute invoice_id.
4 5 6 |
# File 'sig/nfe/resources/consumer_invoice_pending.rbs', line 4 def invoice_id @invoice_id end |
#location ⇒ String? (readonly)
Returns the value of attribute location.
5 6 7 |
# File 'sig/nfe/resources/consumer_invoice_pending.rbs', line 5 def location @location end |
Class Method Details
.new(invoice_id:, location:) ⇒ instance .new(invoice_id, location) ⇒ instance
7 8 |
# File 'sig/nfe/resources/consumer_invoice_pending.rbs', line 7
def self.new: (invoice_id: String?, location: String?) -> instance
| (String? invoice_id, String? location) -> instance
|
Instance Method Details
#issued? ⇒ Boolean
Returns always false for a pending result.
25 26 27 |
# File 'lib/nfe/resources/responses/consumer_invoice_pending.rb', line 25 def issued? false end |
#pending? ⇒ Boolean
Returns always true for a pending result.
20 21 22 |
# File 'lib/nfe/resources/responses/consumer_invoice_pending.rb', line 20 def pending? true end |