class Bugzilla::Classification

Bugzilla::Classification

Bugzilla::Classification class is to access the Bugzilla::WebService::Classification API that allows you to deal with the available Classifications.

Protected Instance Methods

_get(cmd, args) click to toggle source

Bugzilla::Classification#get(params)

Raw Bugzilla API to obtain the information about a set of classifications.

See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Classification.html

# File lib/bugzilla/classification.rb, line 49
def _get(cmd, args)
  requires_version(cmd, 4.4)

  params = {}
  # TODO
  # this whole block looks confuse
  case ids
  when Hash
    raise ArgumentError, sprintf("Invalid parameter: %s", ids.inspect) unless ids.include?('ids') || ids.include?('names')
    params[:ids] = ids['ids'] || ids['names']
  when Array
    r = ids.map {|x| x.kind_of?(Integer) ? x : nil}.compact
    if r.length != ids.length
      params[:names] = ids
    else
      params[:ids] = ids
    end
  when Integer # XXX: different than others, we dont support String here?
      params[:ids] = [ids]
  else
    params[:names] = [ids]
  end
  @iface.call(cmd, params)
end