Class: NavigationTree

Inherits:
Object
  • Object
show all
Defined in:
app/services/navigation_tree.rb

Instance Method Summary collapse

Constructor Details

#initialize(browse_levels, facet_query_hash) ⇒ NavigationTree

Returns a new instance of NavigationTree.



2
3
4
5
# File 'app/services/navigation_tree.rb', line 2

def initialize(browse_levels, facet_query_hash)
  @browse_levels = browse_levels.clone
  @facet_query_hash = facet_query_hash
end

Instance Method Details

#current_levelObject



7
8
9
10
11
12
# File 'app/services/navigation_tree.rb', line 7

def current_level
  return nil unless @facet_query_hash.present?
  @browse_levels.reverse.detect do |browse_level|
    @facet_query_hash.has_key?(browse_level.solr_facet_name)
  end
end