class Fog::Monitoring::Rackspace::Base

Public Instance Methods

compare?(b) click to toggle source
# File lib/rackspace-monitoring/monitoring/models/base.rb, line 21
def compare?(b)
  a_o = prep
  b_o = b.prep
  remain = a_o.reject {|key, value| b_o[key] === value}
  remain.empty?
end
get_entity_id() click to toggle source
# File lib/rackspace-monitoring/monitoring/models/base.rb, line 28
def get_entity_id
  requires :entity
  begin
    requires :entity
    entity_id = entity.identity
  rescue
    requires :entity_id
  end
  entity_id
end
hash() click to toggle source

Back to drawing board on this one I think

# File lib/rackspace-monitoring/monitoring/models/base.rb, line 12
def hash
  attrs = attributes.dup
  attrs.delete_if {|key, value| [:created_at, :updated_at, :id].include?(key)}
  attrs.delete_if {|key, value| value.kind_of?(Base) }
  keys = attrs.keys.map{|sym| sym.to_s}.sort.join ''
  values = attrs.values.map{|sym| sym.to_s}.sort.join ''
  Digest::MD5.hexdigest(keys + values)
end