Class: NavigationTree
- Inherits:
-
Object
- Object
- NavigationTree
- Defined in:
- app/services/navigation_tree.rb
Instance Method Summary collapse
- #current_level ⇒ Object
-
#initialize(browse_levels, facet_query_hash) ⇒ NavigationTree
constructor
A new instance of NavigationTree.
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_level ⇒ Object
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 |