Parent

Class/Module Index [+]

Quicksearch

Admin::Suggestion::Base

Attributes

district_name[RW]

String - name for same district

district_uuid[RW]

String - district uuid to modify

profile[RW]

String - profile affected

scope[RW]

String - scope at which this suggestion applies. One of: general, profile, district, node

type[R]

enable JSON serialization which doesn't record object class

Public Class Methods

important?() click to toggle source
# File lib/admin/suggestion/types.rb, line 45
def self.important?
  false
end
new(attrs) click to toggle source

subclass instances just set attributes given

# File lib/admin/suggestion/types.rb, line 39
def initialize(attrs)
  attrs[:scope] ||= "profile" # most common
  attrs.each_pair {|attr,value| self.send("#{attr}=", value)}
  @type = self.class.to_s
end

Public Instance Methods

id(*ignore_vars) click to toggle source

"ID" that should be unique across serialization or regeneration of the suggestion - subclasses should override as needed, or just specify instance variable names not to include in the hash.

# File lib/admin/suggestion/types.rb, line 32
def id(*ignore_vars)
  Digest::MD5.hexdigest(self.class.to_s +
                        (self.instance_variables - ignore_vars).sort.
                        map {|v| "#{v}=#{self.instance_variable_get v}" }.join)
end
important?() click to toggle source
# File lib/admin/suggestion/types.rb, line 48
def important?
  self.class.important?
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.