Class: CellsV1::Actionbar::Cell

Inherits:
Cell
  • Object
show all
Defined in:
app/cells/lato_view/cells_v1/actionbar/cell.rb

Overview

Cella Actionbar

Constant Summary collapse

@@align =

Lista allineamenti accettati dalla cella per i widget

%(left right)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(links: nil, title: '', widgets: nil) ⇒ Cell

Returns a new instance of Cell.



27
28
29
30
31
32
# File 'app/cells/lato_view/cells_v1/actionbar/cell.rb', line 27

def initialize(links: nil, title: '', widgets: nil)
  # assegno i valori alle variabili di istanza
  @links = links if links && check_links(links)
  @title = title
  @widgets = widgets if widgets && check_widgets(widgets)
end

Instance Attribute Details

Lista di links da mostrare nella Actionbar secondo la struttura [[‘Nome link’, ‘url’], [‘Nome link’, ‘url’]]

  • default: nil



14
15
16
# File 'app/cells/lato_view/cells_v1/actionbar/cell.rb', line 14

def links
  @links
end

#titleObject

Titolo principale da mostrare nella Actionbar

  • default: nil



18
19
20
# File 'app/cells/lato_view/cells_v1/actionbar/cell.rb', line 18

def title
  @title
end

#widgetsObject

Celle da inserire all’interno della Actionbar. Le celle per ora supportate sono: (searchbar, dropdown, buttongroup). I widget devono essere inseriti sotto forma di array che segue la struttura [[cella_widget, ‘allineamento’], […]]

  • default: nil



25
26
27
# File 'app/cells/lato_view/cells_v1/actionbar/cell.rb', line 25

def widgets
  @widgets
end

Instance Method Details

#showObject



34
35
36
# File 'app/cells/lato_view/cells_v1/actionbar/cell.rb', line 34

def show
  render 'show.html'
end