module Aquarium::Aspects::Advice

Constants

KINDS_IN_PRIORITY_ORDER
UNKNOWN_ADVICE_KIND

Public Class Methods

compare_advice_kinds(kind1, kind2) click to toggle source
   # File lib/aquarium/aspects/advice.rb
29 def self.compare_advice_kinds kind1, kind2
30   if kind1.nil?
31     return kind2.nil? ? 0 : -1
32   end
33   return 1 if kind2.nil?
34   if kind1.eql?(UNKNOWN_ADVICE_KIND)
35     return kind2.eql?(UNKNOWN_ADVICE_KIND) ? 0 : -1
36   else
37     return kind2.eql?(UNKNOWN_ADVICE_KIND) ? 1 : KINDS_IN_PRIORITY_ORDER.index(kind1) <=> KINDS_IN_PRIORITY_ORDER.index(kind2)
38   end
39 end
debug_backtraces() click to toggle source
   # File lib/aquarium/aspects/advice.rb
18 def self.debug_backtraces; @DEBUG_BACKTRACES; end
debug_backtraces=( val ) click to toggle source
   # File lib/aquarium/aspects/advice.rb
19 def self.debug_backtraces=( val ); @DEBUG_BACKTRACES = val; end
kinds() click to toggle source
   # File lib/aquarium/aspects/advice.rb
21 def self.kinds; KINDS_IN_PRIORITY_ORDER; end
sort_by_priority_order(advice_kinds) click to toggle source
   # File lib/aquarium/aspects/advice.rb
23 def self.sort_by_priority_order advice_kinds
24   advice_kinds.sort do |x,y|
25     KINDS_IN_PRIORITY_ORDER.index(x.to_sym) <=> KINDS_IN_PRIORITY_ORDER.index(y.to_sym)
26   end.map {|x| x.to_sym}
27 end