Class: Nfe::TaxCoupon::Item
- Inherits:
-
Data
- Object
- Data
- Nfe::TaxCoupon::Item
- Defined in:
- lib/nfe/resources/dto/consumer_invoice_query/tax_coupon.rb,
sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs
Overview
A single coupon line item (+det+ / prod).
Instance Attribute Summary collapse
-
#cfop ⇒ Object
readonly
Returns the value of attribute cfop.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ String?
readonly
Returns the value of attribute description.
-
#gross_amount ⇒ Object
readonly
Returns the value of attribute gross_amount.
-
#net_amount ⇒ Object
readonly
Returns the value of attribute net_amount.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#unit_amount ⇒ Object
readonly
Returns the value of attribute unit_amount.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize ⇒ Item
Returns a new instance of Item.
73 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 73
def initialize: (code: untyped, description: String?, quantity: untyped, unit_amount: untyped, net_amount: untyped, gross_amount: untyped, cfop: untyped) -> void
|
Instance Attribute Details
#cfop ⇒ Object (readonly)
Returns the value of attribute cfop.
69 70 71 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 69 def cfop @cfop end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
63 64 65 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 63 def code @code end |
#description ⇒ String? (readonly)
Returns the value of attribute description.
64 65 66 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 64 def description @description end |
#gross_amount ⇒ Object (readonly)
Returns the value of attribute gross_amount.
68 69 70 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 68 def gross_amount @gross_amount end |
#net_amount ⇒ Object (readonly)
Returns the value of attribute net_amount.
67 68 69 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 67 def net_amount @net_amount end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
65 66 67 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 65 def quantity @quantity end |
#unit_amount ⇒ Object (readonly)
Returns the value of attribute unit_amount.
66 67 68 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 66 def unit_amount @unit_amount end |
Class Method Details
.from_api(payload) ⇒ Nfe::TaxCoupon::Item?
119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/nfe/resources/dto/consumer_invoice_query/tax_coupon.rb', line 119 def self.from_api(payload) return nil if payload.nil? new( code: payload["code"]&.to_s, description: payload["description"], quantity: payload["quantity"], unit_amount: payload["unitAmount"], net_amount: payload["netAmount"], gross_amount: payload["grossAmount"], cfop: payload["cfop"] ) end |
.new ⇒ instance
72 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 72
def self.new: (code: untyped, description: String?, quantity: untyped, unit_amount: untyped, net_amount: untyped, gross_amount: untyped, cfop: untyped) -> instance
|