Class: Decidim::CardMetadataCell

Inherits:
ViewModel
  • Object
show all
Includes:
Cell::ViewModel::Partial, DateRangeHelper, ViewHooksHelper
Defined in:
app/cells/decidim/card_metadata_cell.rb

Overview

This cell is used to display metadata inside a list card so other cells only have to customize a few methods or overwrite views.

Instance Method Summary collapse

Methods included from ViewHooksHelper

#render_hook

Methods included from DateRangeHelper

#format_date_range

Constructor Details

#initializeCardMetadataCell

Returns a new instance of CardMetadataCell.



19
20
21
22
23
24
# File 'app/cells/decidim/card_metadata_cell.rb', line 19

def initialize(*)
  super

  @items ||= []
  @items << space_item if show_space?
end

Instance Method Details

#showObject



13
14
15
16
17
# File 'app/cells/decidim/card_metadata_cell.rb', line 13

def show
  return if items.blank?

  render
end