Class: Nfe::StateTaxLegalEntity::EconomicActivity

Inherits:
Data
  • Object
show all
Defined in:
lib/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rb,
sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs

Overview

Economic activity (CNAE) nested inside a state-tax registration.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEconomicActivity

Returns a new instance of EconomicActivity.

Parameters:

  • type: (Object)
  • code: (String, nil)
  • description: (String, nil)


24
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 24

def initialize: (type: untyped, code: String?, description: String?) -> void

Instance Attribute Details

#codeString? (readonly)

Returns the value of attribute code.

Returns:

  • (String, nil)


19
20
21
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 19

def code
  @code
end

#descriptionString? (readonly)

Returns the value of attribute description.

Returns:

  • (String, nil)


20
21
22
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 20

def description
  @description
end

#typeObject (readonly)

Returns the value of attribute type.

Returns:

  • (Object)


18
19
20
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 18

def type
  @type
end

Class Method Details

.from_api(payload) ⇒ Nfe::StateTaxLegalEntity::EconomicActivity?

Parameters:

  • payload (Hash[untyped, untyped], nil)

Returns:



45
46
47
48
49
50
51
52
53
# File 'lib/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rb', line 45

def self.from_api(payload)
  return nil if payload.nil?

  new(
    type: payload["type"],
    code: payload["code"]&.to_s,
    description: payload["description"]
  )
end

.newinstance

Parameters:

  • type: (Object)
  • code: (String, nil)
  • description: (String, nil)

Returns:

  • (instance)


23
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 23

def self.new: (type: untyped, code: String?, description: String?) -> instance