Skip to content

No implicit conversion of Hash into Array (TypeError) #40

@iDevPro

Description

@iDevPro

Do I understand correctly that there will be an error in this function if there is no data?
I get error concat': [!] no implicit conversion of Hash into Array (TypeError) when no data in response available
Or suppose some garbage in response. But in list_assets when no response we have Hash.new() :)

def list_all_assets(repository: nil)
      Array.new.tap do |assets|
        loop do
          # Error: concat': [!] no implicit conversion of Hash into Array (TypeError)
          assets.concat(list_assets(repository: repository, paginate: true))
          break unless paginate?
        end
      end
    end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions