Class: ClusterAncestorsFinder
- Inherits:
 - 
      Object
      
        
- Object
 - ClusterAncestorsFinder
 
 
- Includes:
 - Gitlab::Utils::StrongMemoize
 
- Defined in:
 - app/finders/cluster_ancestors_finder.rb
 
Instance Method Summary collapse
- #execute ⇒ Object
 - #has_ancestor_clusters? ⇒ Boolean
 - 
  
    
      #initialize(clusterable, current_user)  ⇒ ClusterAncestorsFinder 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of ClusterAncestorsFinder.
 
Constructor Details
#initialize(clusterable, current_user) ⇒ ClusterAncestorsFinder
Returns a new instance of ClusterAncestorsFinder.
      6 7 8 9  | 
    
      # File 'app/finders/cluster_ancestors_finder.rb', line 6 def initialize(clusterable, current_user) @clusterable = clusterable @current_user = current_user end  | 
  
Instance Method Details
#execute ⇒ Object
      11 12 13 14 15  | 
    
      # File 'app/finders/cluster_ancestors_finder.rb', line 11 def execute return [] unless can_read_clusters? clusterable.clusters + ancestor_clusters end  | 
  
#has_ancestor_clusters? ⇒ Boolean
      17 18 19  | 
    
      # File 'app/finders/cluster_ancestors_finder.rb', line 17 def has_ancestor_clusters? ancestor_clusters.any? end  |