{"record":{"id":"24eaa5da086fa063","repo":"ruby/ruby","slug":"expected-array-of-or-hash-of-components-of-self","errorCode":null,"errorMessage":"expected Array of or Hash of components of #{self} (#{component.join(', ')})","messagePattern":"expected Array of or Hash of components of #(.+?) \\(#(.+?)\\)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/uri/generic.rb","lineNumber":130,"sourceCode":"    # with check.  Components are: scheme, userinfo, host, port, registry, path,\n    # opaque, query, and fragment. You can provide arguments either by an Array or a Hash.\n    # See ::new for hash keys to use or for order of array items.\n    #\n    def self.build(args)\n      if args.kind_of?(Array) &&\n          args.size == ::URI::Generic::COMPONENT.size\n        tmp = args.dup\n      elsif args.kind_of?(Hash)\n        tmp = ::URI::Generic::COMPONENT.collect do |c|\n          if args.include?(c)\n            args[c]\n          else\n            nil\n          end\n        end\n      else\n        component = self.component rescue ::URI::Generic::COMPONENT\n        raise ArgumentError,\n              \"expected Array of or Hash of components of #{self} (#{component.join(', ')})\"\n      end\n\n      tmp << nil\n      tmp << true\n      return self.new(*tmp)\n    end\n\n    #\n    # == Args\n    #\n    # +scheme+::\n    #   Protocol scheme, i.e. 'http','ftp','mailto' and so on.\n    # +userinfo+::\n    #   User name and password, i.e. 'sdmitry:bla'.\n    # +host+::\n    #   Server host name.\n    # +port+::","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/ruby/ruby/blob/0e5b888e1c355f3f728f2659f085820937dada48/lib/uri/generic.rb#L112-L148","documentation":"Error \"expected Array of or Hash of components of #{self} (#{component.join(', ')})\" thrown in ruby/ruby.","triggerScenarios":"Thrown at lib/uri/generic.rb:130 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0e5b888e1c355f3f728f2659f085820937dada48","analyzedAt":"2026-08-21T14:25:43.473Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}