Class: Rubyzilla::Bug

Inherits:
Object
  • Object
show all
Defined in:
lib/taskmapper-bugzilla.rb

Instance Method Summary collapse

Instance Method Details

#comments(attributes = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/taskmapper-bugzilla.rb', line 16

def comments(attributes = {})
  if !attributes.has_key? :comment_ids
    attributes.merge!({:ids => [self.id]})
  end
  comments = []
  result = Bugzilla.server.call("Bug.comments", attributes)
  if attributes.has_key? :ids
    comments = result["bugs"]["#{self.id}"]["comments"]
  else
    attributes[:comment_ids].each { |comment_id| comments << result["comments"]["#{comment_id}"] }
  end
  comments
end