Class: Nfe::Generated::NfConsumidorV2::FuelResource

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFuelResource

Returns a new instance of FuelResource.

Parameters:

  • amount_temp: (Float, nil)
  • cide: (CIDEResource)
  • code_anp: (String, nil)
  • codif: (String, nil)
  • description_anp: (String, nil)
  • fuel_origin: (FuelOriginResource)
  • percentage_glp: (Float, nil)
  • percentage_gni: (Float, nil)
  • percentage_ng: (Float, nil)
  • percentage_ngn: (Float, nil)
  • pump: (PumpResource)
  • starting_amount: (Float, nil)
  • state_buyer: (String, nil)


23
# File 'sig/nfe/generated/nf_consumidor_v2/fuel_resource.rbs', line 23

def initialize: (?amount_temp: Float?, ?cide: CIDEResource, ?code_anp: String?, ?codif: String?, ?description_anp: String?, ?fuel_origin: FuelOriginResource, ?percentage_glp: Float?, ?percentage_gni: Float?, ?percentage_ng: Float?, ?percentage_ngn: Float?, ?pump: PumpResource, ?starting_amount: Float?, ?state_buyer: String?) -> void

Instance Attribute Details

#amount_tempObject (readonly)

Returns the value of attribute amount_temp

Returns:

  • (Object)

    the current value of amount_temp



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

def amount_temp
  @amount_temp
end

#cideObject (readonly)

Returns the value of attribute cide

Returns:

  • (Object)

    the current value of cide



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

def cide
  @cide
end

#code_anpObject (readonly)

Returns the value of attribute code_anp

Returns:

  • (Object)

    the current value of code_anp



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

def code_anp
  @code_anp
end

#codifObject (readonly)

Returns the value of attribute codif

Returns:

  • (Object)

    the current value of codif



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

def codif
  @codif
end

#description_anpObject (readonly)

Returns the value of attribute description_anp

Returns:

  • (Object)

    the current value of description_anp



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

def description_anp
  @description_anp
end

#fuel_originObject (readonly)

Returns the value of attribute fuel_origin

Returns:

  • (Object)

    the current value of fuel_origin



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

def fuel_origin
  @fuel_origin
end

#percentage_glpObject (readonly)

Returns the value of attribute percentage_glp

Returns:

  • (Object)

    the current value of percentage_glp



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

def percentage_glp
  @percentage_glp
end

#percentage_gniObject (readonly)

Returns the value of attribute percentage_gni

Returns:

  • (Object)

    the current value of percentage_gni



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

def percentage_gni
  @percentage_gni
end

#percentage_ngObject (readonly)

Returns the value of attribute percentage_ng

Returns:

  • (Object)

    the current value of percentage_ng



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

def percentage_ng
  @percentage_ng
end

#percentage_ngnObject (readonly)

Returns the value of attribute percentage_ngn

Returns:

  • (Object)

    the current value of percentage_ngn



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

def percentage_ngn
  @percentage_ngn
end

#pumpObject (readonly)

Returns the value of attribute pump

Returns:

  • (Object)

    the current value of pump



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

def pump
  @pump
end

#starting_amountObject (readonly)

Returns the value of attribute starting_amount

Returns:

  • (Object)

    the current value of starting_amount



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

def starting_amount
  @starting_amount
end

#state_buyerObject (readonly)

Returns the value of attribute state_buyer

Returns:

  • (Object)

    the current value of state_buyer



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

def state_buyer
  @state_buyer
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
22
23
24
25
26
27
28
# File 'lib/nfe/generated/nf_consumidor_v2/fuel_resource.rb', line 10

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

  new(
    amount_temp: payload["amountTemp"],
    cide: CIDEResource.from_api(payload["cide"]),
    code_anp: payload["codeANP"],
    codif: payload["codif"],
    description_anp: payload["descriptionANP"],
    fuel_origin: FuelOriginResource.from_api(payload["fuelOrigin"]),
    percentage_glp: payload["percentageGLP"],
    percentage_gni: payload["percentageGNi"],
    percentage_ng: payload["percentageNG"],
    percentage_ngn: payload["percentageNGn"],
    pump: PumpResource.from_api(payload["pump"]),
    starting_amount: payload["startingAmount"],
    state_buyer: payload["stateBuyer"],
  )
end

.newinstance

Parameters:

  • amount_temp: (Float, nil)
  • cide: (CIDEResource)
  • code_anp: (String, nil)
  • codif: (String, nil)
  • description_anp: (String, nil)
  • fuel_origin: (FuelOriginResource)
  • percentage_glp: (Float, nil)
  • percentage_gni: (Float, nil)
  • percentage_ng: (Float, nil)
  • percentage_ngn: (Float, nil)
  • pump: (PumpResource)
  • starting_amount: (Float, nil)
  • state_buyer: (String, nil)

Returns:

  • (instance)


22
# File 'sig/nfe/generated/nf_consumidor_v2/fuel_resource.rbs', line 22

def self.new: (?amount_temp: Float?, ?cide: CIDEResource, ?code_anp: String?, ?codif: String?, ?description_anp: String?, ?fuel_origin: FuelOriginResource, ?percentage_glp: Float?, ?percentage_gni: Float?, ?percentage_ng: Float?, ?percentage_ngn: Float?, ?pump: PumpResource, ?starting_amount: Float?, ?state_buyer: String?) -> instance