Class: SirTrevorRails::Blocks::FeaturedBrowseCategoriesBlock
- Inherits:
-
SirTrevorRails::Block
- Object
- SirTrevorRails::Block
- SirTrevorRails::Blocks::FeaturedBrowseCategoriesBlock
- Defined in:
- app/models/sir_trevor_rails/blocks/featured_browse_categories_block.rb
Instance Attribute Summary collapse
-
#solr_helper ⇒ Object
readonly
Returns the value of attribute solr_helper.
Instance Method Summary collapse
Instance Attribute Details
#solr_helper ⇒ Object (readonly)
Returns the value of attribute solr_helper.
3 4 5 |
# File 'app/models/sir_trevor_rails/blocks/featured_browse_categories_block.rb', line 3 def solr_helper @solr_helper end |
Instance Method Details
#block_objects ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'app/models/sir_trevor_rails/blocks/featured_browse_categories_block.rb', line 13 def block_objects @block_objects ||= sorted_browse_categories.map do |category| OpenStruct.new( browse_category: category, count: item_counts_for_category(category) ) end end |
#display_item_counts? ⇒ Boolean
9 10 11 |
# File 'app/models/sir_trevor_rails/blocks/featured_browse_categories_block.rb', line 9 def display_item_counts? as_json[:data][:"display-item-counts"] end |
#with_solr_helper(solr_helper) ⇒ Object
5 6 7 |
# File 'app/models/sir_trevor_rails/blocks/featured_browse_categories_block.rb', line 5 def with_solr_helper solr_helper @solr_helper = solr_helper end |