app/models/server.rb
#
# Retreives the combined parameter list of the Provider Account, Cluster and this Server
# and provides a [] access method which retreives keys based on Parameter Class Priority
#
Retreives the combined parameter list of the Provider Account, Cluster and this Server
and provides a [] access method which retreives keys based on Parameter Class Priority
Retreives the combined parameter list of the Provider Account Cluster and this Server and provides a [] access method which retreives keys based on Parameter Class Priority
def parameters
    _parameters = (
      self.cluster.provider_account.provider_account_parameters +
      self.cluster.cluster_parameters +
      self.server_parameters
    )
    _parameters.class_eval(<<-EOS, __FILE__, __LINE__)
      # order of priority (highest to lowest): server -> cluster -> provider account
      alias :__array_access_orig :[]
      def [](key)
        return self.__array_access_orig(key) if key.is_a? Integer
        matches = self.select { |p| p.name == key }
        return case matches.size
          when 0
            nil
          when 1
            matches.first
          else
            matches.sort_by {|m| Server::PARAMETER_PRIORITY.index(m.class) }.first
        end
      end
    EOS
    _parameters
  end
def parameters _parameters = ( self . cluster . provider_account . provider_account_parameters + self . cluster . cluster_parameters + self . server_parameters ) _parameters . class_eval ( <<-EOS , __FILE__ , __LINE__ ) 
      # order of priority (highest to lowest): server -> cluster -> provider account
      alias :__array_access_orig :[]
      def [](key)
        return self.__array_access_orig(key) if key.is_a? Integer
        matches = self.select { |p| p.name == key }
        return case matches.size
          when 0
            nil
          when 1
            matches.first
          else
            matches.sort_by {|m| Server::PARAMETER_PRIORITY.index(m.class) }.first
        end
      end
     EOS _parameters end
Retreives the combined parameter list of the Provider Account, Cluster and this Server
and provides a [] access method which retreives keys based on Parameter Class Priority
Retreives the combined parameter list of the Provider Account Cluster and this Server and provides a [] access method which retreives keys based on Parameter Class Priority