Class: Nfe::Generated::NfConsumidorV2::VolumeResource

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeVolumeResource

Returns a new instance of VolumeResource.

Parameters:

  • brand: (String, nil)
  • gross_weight: (Float, nil)
  • net_weight: (Float, nil)
  • species: (String, nil)
  • volume_numeration: (String, nil)
  • volume_quantity: (Integer, nil)


16
# File 'sig/nfe/generated/nf_consumidor_v2/volume_resource.rbs', line 16

def initialize: (?brand: String?, ?gross_weight: Float?, ?net_weight: Float?, ?species: String?, ?volume_numeration: String?, ?volume_quantity: Integer?) -> void

Instance Attribute Details

#brandObject (readonly)

Returns the value of attribute brand

Returns:

  • (Object)

    the current value of brand



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

def brand
  @brand
end

#gross_weightObject (readonly)

Returns the value of attribute gross_weight

Returns:

  • (Object)

    the current value of gross_weight



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

def gross_weight
  @gross_weight
end

#net_weightObject (readonly)

Returns the value of attribute net_weight

Returns:

  • (Object)

    the current value of net_weight



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

def net_weight
  @net_weight
end

#speciesObject (readonly)

Returns the value of attribute species

Returns:

  • (Object)

    the current value of species



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

def species
  @species
end

#volume_numerationObject (readonly)

Returns the value of attribute volume_numeration

Returns:

  • (Object)

    the current value of volume_numeration



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

def volume_numeration
  @volume_numeration
end

#volume_quantityObject (readonly)

Returns the value of attribute volume_quantity

Returns:

  • (Object)

    the current value of volume_quantity



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

def volume_quantity
  @volume_quantity
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
19
20
21
# File 'lib/nfe/generated/nf_consumidor_v2/volume_resource.rb', line 10

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

  new(
    brand: payload["brand"],
    gross_weight: payload["grossWeight"],
    net_weight: payload["netWeight"],
    species: payload["species"],
    volume_numeration: payload["volumeNumeration"],
    volume_quantity: payload["volumeQuantity"],
  )
end

.newinstance

Parameters:

  • brand: (String, nil)
  • gross_weight: (Float, nil)
  • net_weight: (Float, nil)
  • species: (String, nil)
  • volume_numeration: (String, nil)
  • volume_quantity: (Integer, nil)

Returns:

  • (instance)


15
# File 'sig/nfe/generated/nf_consumidor_v2/volume_resource.rbs', line 15

def self.new: (?brand: String?, ?gross_weight: Float?, ?net_weight: Float?, ?species: String?, ?volume_numeration: String?, ?volume_quantity: Integer?) -> instance