class Bugzilla::Product
rdoc
Bugzilla::Product
¶ ↑
Bugzilla::Product
class is to access the Bugzilla::WebService::Product API that allows you to list the available Products and get information about them.
Public Instance Methods
rdoc
Bugzilla::Product#accessible_products
¶ ↑
Returns Hash table for the products information that the user can search or enter bugs against. the Hash key is the product name and containing a Hash table which contains id, name, description, is_active, default_milestone, has_uncomfirmed, classification, components, versions and milestones. please see www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Product.html#get for more details.
# File lib/bugzilla/product.rb, line 82 def accessible_products ids = get_accessible_products Hash[*get(ids)['products'].map { |x| [x['name'], x] }.flatten] end
rdoc
Bugzilla::Product#enterable_products
¶ ↑
Returns Hash table for the products information that the user can enter bugs against. the Hash key is the product name and containing a Hash table which contains id, name, description, is_active, default_milestone, has_uncomfirmed, classification, components, versions and milestones. please see www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Product.html#get for more details.
# File lib/bugzilla/product.rb, line 64 def enterable_products ids = get_enterable_products Hash[*get(ids)['products'].map { |x| [x['name'], x] }.flatten] end
rdoc
Bugzilla::Product#selectable_products
¶ ↑
Returns Hash table for the products information that the user can search on. the Hash key is the product name and containing a Hash table which contains id, name, description, is_active, default_milestone, has_uncomfirmed, classification, components, versions and milestones. please see www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Product.html#get for more details.
# File lib/bugzilla/product.rb, line 46 def selectable_products ids = get_selectable_products Hash[*get(ids)['products'].map { |x| [x['name'], x] }.flatten] end
Protected Instance Methods
# File lib/bugzilla/product.rb, line 169 def __create(cmd, *args) # FIXME end
# File lib/bugzilla/product.rb, line 173 def __update(cmd, *_args) requires_version(cmd, 4.4) # FIXME end
# File lib/bugzilla/product.rb, line 141 def _get(cmd, ids, *_args) # This is still in experimental and apparently the behavior was changed since 4.2. # We don't keep the backward-compatibility and just require the proper version here. requires_version(cmd, 4.2) params = {} if ids.is_a?(Hash) raise ArgumentError, format('Invalid parameter: %s', ids.inspect) unless ids.include?('ids') || ids.include?('names') params[:ids] = ids['ids'] || ids['names'] elsif ids.is_a?(Array) r = ids.map { |x| x.is_a?(Integer) ? x : nil }.compact if r.length != ids.length params[:names] = ids else params[:ids] = ids end else if ids.is_a?(Integer) params[:ids] = [ids] else params[:names] = [ids] end end @iface.call(cmd, params) end
# File lib/bugzilla/product.rb, line 137 def _get_accessible_products(cmd, *_args) @iface.call(cmd) end
# File lib/bugzilla/product.rb, line 133 def _get_enterable_products(cmd, *_args) @iface.call(cmd) end
rdoc
Bugzilla::Product#get(params)¶ ↑
Raw Bugzilla
API to obtain a list of information about the products passed to it.
See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Product.html
# File lib/bugzilla/product.rb, line 129 def _get_selectable_products(cmd, *_args) @iface.call(cmd) end