module ActiveBugzilla::Bug::ServiceManagement

Constants

ATTRIBUTES_XMLRPC_RENAMES_MAP

Public Instance Methods

attribute_names() click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 114
def attribute_names
  self.class.attribute_names
end

Private Instance Methods

fetch_attribute(key) click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 171
def fetch_attribute(key)
  service.get(@id, :include_fields => [key]).first[key]
end
fetch_comments() click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 167
def fetch_comments
  service.comments(:ids => @id)['bugs'][@id.to_s]['comments']
end
raw_attribute(key) click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 162
def raw_attribute(key)
  raw_attribute_set(key, fetch_attribute(key)) unless raw_attributes.key?(key)
  raw_attributes[key]
end
raw_attribute_set(key, value) click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 157
def raw_attribute_set(key, value)
  raw_attributes
  @raw_attributes[key] = value
end
raw_attributes() click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 153
def raw_attributes
  @raw_attributes ||= self.class.normalize_attributes_from_service(raw_data)
end
raw_comments() click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 149
def raw_comments
  @raw_comments ||= (raw_attributes['comments'] || fetch_comments)
end
raw_data() click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 141
def raw_data
  @raw_data ||= service.get(@id, :include_fields => self.class.default_service_attributes).first
end
raw_flags() click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 145
def raw_flags
  @raw_flags ||= raw_attribute('flags')
end
raw_reset() click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 124
def raw_reset
  @raw_data       = nil
  @raw_comments   = nil
  @raw_flags      = nil
  @raw_attributes = nil
end
raw_update(attributes) click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 131
def raw_update(attributes)
  attributes = self.class.normalize_attributes_to_service(attributes)
  result = service.update(@id, attributes).first

  id = result['id']
  raise "Error - Expected to update id <#{@id}>, but updated <#{id}>" unless id == @id

  result
end
service() click to toggle source
# File lib/active_bugzilla/bug/service_management.rb, line 120
def service
  self.class.service
end