Class: Nfe::Generated::CalculoImpostosV1::TaxCodePaginatedResponse

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTaxCodePaginatedResponse

Returns a new instance of TaxCodePaginatedResponse.

Parameters:

  • current_page: (Integer)
  • items: (Array[TaxCode], nil)
  • total_count: (Integer)
  • total_pages: (Integer)


14
# File 'sig/nfe/generated/calculo_impostos_v1/tax_code_paginated_response.rbs', line 14

def initialize: (?current_page: Integer, ?items: Array[TaxCode]?, ?total_count: Integer, ?total_pages: Integer) -> void

Instance Attribute Details

#current_pageObject (readonly)

Returns the value of attribute current_page

Returns:

  • (Object)

    the current value of current_page



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/tax_code_paginated_response.rb', line 9

def current_page
  @current_page
end

#itemsObject (readonly)

Returns the value of attribute items

Returns:

  • (Object)

    the current value of items



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/tax_code_paginated_response.rb', line 9

def items
  @items
end

#total_countObject (readonly)

Returns the value of attribute total_count

Returns:

  • (Object)

    the current value of total_count



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/tax_code_paginated_response.rb', line 9

def total_count
  @total_count
end

#total_pagesObject (readonly)

Returns the value of attribute total_pages

Returns:

  • (Object)

    the current value of total_pages



9
10
11
# File 'lib/nfe/generated/calculo_impostos_v1/tax_code_paginated_response.rb', line 9

def total_pages
  @total_pages
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
# File 'lib/nfe/generated/calculo_impostos_v1/tax_code_paginated_response.rb', line 10

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

  new(
    current_page: payload["currentPage"],
    items: (payload["items"] || []).map { |e| TaxCode.from_api(e) },
    total_count: payload["totalCount"],
    total_pages: payload["totalPages"],
  )
end

.newinstance

Parameters:

  • current_page: (Integer)
  • items: (Array[TaxCode], nil)
  • total_count: (Integer)
  • total_pages: (Integer)

Returns:

  • (instance)


13
# File 'sig/nfe/generated/calculo_impostos_v1/tax_code_paginated_response.rbs', line 13

def self.new: (?current_page: Integer, ?items: Array[TaxCode]?, ?total_count: Integer, ?total_pages: Integer) -> instance