Class: SirTrevorRails::Blocks::FeaturedBrowseCategoriesBlock

Inherits:
SirTrevorRails::Block
  • Object
show all
Defined in:
app/models/sir_trevor_rails/blocks/featured_browse_categories_block.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#solr_helperObject (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_objectsObject



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

Returns:

  • (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