Class: Nfe::Generated::NfConsumidorV2::GovernmentPurchaseResource

Inherits:
Data
  • Object
show all
Defined in:
lib/nfe/generated/nf_consumidor_v2/government_purchase_resource.rb,
sig/nfe/generated/nf_consumidor_v2/government_purchase_resource.rbs

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGovernmentPurchaseResource

Returns a new instance of GovernmentPurchaseResource.

Parameters:

  • entity_type: (Object)
  • operation_type: (Object)
  • rate_reduction: (Float, nil)


13
# File 'sig/nfe/generated/nf_consumidor_v2/government_purchase_resource.rbs', line 13

def initialize: (?entity_type: untyped, ?operation_type: untyped, ?rate_reduction: Float?) -> void

Instance Attribute Details

#entity_typeObject (readonly)

Returns the value of attribute entity_type

Returns:

  • (Object)

    the current value of entity_type



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/government_purchase_resource.rb', line 9

def entity_type
  @entity_type
end

#operation_typeObject (readonly)

Returns the value of attribute operation_type

Returns:

  • (Object)

    the current value of operation_type



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/government_purchase_resource.rb', line 9

def operation_type
  @operation_type
end

#rate_reductionObject (readonly)

Returns the value of attribute rate_reduction

Returns:

  • (Object)

    the current value of rate_reduction



9
10
11
# File 'lib/nfe/generated/nf_consumidor_v2/government_purchase_resource.rb', line 9

def rate_reduction
  @rate_reduction
end

Class Method Details

.from_api(payload) ⇒ instance?

Parameters:

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

Returns:

  • (instance, nil)


10
11
12
13
14
15
16
17
18
# File 'lib/nfe/generated/nf_consumidor_v2/government_purchase_resource.rb', line 10

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

  new(
    entity_type: payload["entityType"],
    operation_type: payload["operationType"],
    rate_reduction: payload["rateReduction"],
  )
end

.newinstance

Parameters:

  • entity_type: (Object)
  • operation_type: (Object)
  • rate_reduction: (Float, nil)

Returns:

  • (instance)


12
# File 'sig/nfe/generated/nf_consumidor_v2/government_purchase_resource.rbs', line 12

def self.new: (?entity_type: untyped, ?operation_type: untyped, ?rate_reduction: Float?) -> instance