Class: CellsV1::Dropdown::Cell

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

Overview

Cella Actionbar

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Cell.



20
21
22
23
24
25
# File 'app/cells/lato_view/cells_v1/dropdown/cell.rb', line 20

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

Instance Attribute Details

#buttonObject

Testo da inserire come nome nel pulsante che apre il Dropdown

  • default: nil



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

def button
  @button
end

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

  • default: nil



10
11
12
# File 'app/cells/lato_view/cells_v1/dropdown/cell.rb', line 10

def links
  @links
end

#titleObject

Titolo principale da mostrare nel dropdown

  • default: nil



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

def title
  @title
end

Instance Method Details

#showObject



27
28
29
# File 'app/cells/lato_view/cells_v1/dropdown/cell.rb', line 27

def show
  render 'show.html'
end