Module: SirTrevorRails::Blocks::Displayable
- Included in:
- BrowseBlock, FeaturedPagesBlock, LinkToSearchBlock, SearchResultsBlock, SolrDocumentsBlock
- Defined in:
- app/models/sir_trevor_rails/blocks/displayable.rb
Overview
Mixin for blocks that display text
Instance Method Summary collapse
Instance Method Details
#item_ids ⇒ Object
10 11 12 |
# File 'app/models/sir_trevor_rails/blocks/displayable.rb', line 10 def item_ids items.map { |v| v[:id] } end |
#items ⇒ Object
6 7 8 |
# File 'app/models/sir_trevor_rails/blocks/displayable.rb', line 6 def items item_values.select { |x| x[:display] == 'true' } end |
#ordered_items ⇒ Object
14 15 16 |
# File 'app/models/sir_trevor_rails/blocks/displayable.rb', line 14 def ordered_items items.sort_by { |x| x[:weight] }.map { |x| x[:id] } end |