Class: Nfe::TaxCode
- Inherits:
-
Data
- Object
- Data
- Nfe::TaxCode
- Defined in:
- lib/nfe/resources/dto/tax_codes/tax_code_paginated_response.rb,
sig/nfe/resources/dto/tax_codes/tax_code_paginated_response.rbs
Overview
A single CT-e tax-code entry (operation code, acquisition purpose, issuer or
recipient tax profile). Hand-written: the consulta-cte tax-code endpoints
are schema-less in the OpenAPI spec, so the generator produces no usable
model. TaxCode.from_api maps the API camelCase keys onto snake_case members and is
nil-tolerant (+from_api(nil)+ returns nil).
Instance Attribute Summary collapse
-
#code ⇒ String?
readonly
Returns the value of attribute code.
-
#description ⇒ String?
readonly
Returns the value of attribute description.
Class Method Summary collapse
-
.from_api(payload) ⇒ Nfe::TaxCode?
Build a TaxCode from an API payload.
- .new ⇒ instance
Instance Method Summary collapse
-
#initialize ⇒ TaxCode
constructor
A new instance of TaxCode.
Constructor Details
#initialize ⇒ TaxCode
Returns a new instance of TaxCode.
9 |
# File 'sig/nfe/resources/dto/tax_codes/tax_code_paginated_response.rbs', line 9
def initialize: (code: String?, description: String?) -> void
|
Instance Attribute Details
#code ⇒ String? (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'sig/nfe/resources/dto/tax_codes/tax_code_paginated_response.rbs', line 3 def code @code end |
#description ⇒ String? (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'sig/nfe/resources/dto/tax_codes/tax_code_paginated_response.rbs', line 4 def description @description end |
Class Method Details
.from_api(payload) ⇒ Nfe::TaxCode?
Build a Nfe::TaxCode from an API payload.
14 15 16 17 18 19 20 21 |
# File 'lib/nfe/resources/dto/tax_codes/tax_code_paginated_response.rb', line 14 def self.from_api(payload) return nil if payload.nil? new( code: payload["code"], description: payload["description"] ) end |
.new ⇒ instance
8 |
# File 'sig/nfe/resources/dto/tax_codes/tax_code_paginated_response.rbs', line 8
def self.new: (code: String?, description: String?) -> instance
|