Class: LatoView::Buttongroup::Cell

Inherits:
Cell
  • Object
show all
Defined in:
app/concepts/lato_view/buttongroup/cell.rb

Overview

Cella Buttongroup

Constant Summary collapse

@@styles =

Lista stili possibili per il bottongroup

VIEW_CELLSSTYLES

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(links: nil, size: nil, style: 'normal') ⇒ Cell

Returns a new instance of Cell.



22
23
24
25
26
27
28
29
# File 'app/concepts/lato_view/buttongroup/cell.rb', line 22

def initialize(links: nil, size: nil, style: 'normal')
  # eseguo brevi controlli sull'input
  raise 'Bottongroup Concept: style value in not correct' unless @@styles.include? style.to_s
  # assegno i valori alle variabili di istanza
  @links = links if links && check_links(links)
  @size = size
  @style = style
end

Instance Attribute Details

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

  • default: nil



12
13
14
# File 'app/concepts/lato_view/buttongroup/cell.rb', line 12

def links
  @links
end

#sizeObject

Dimensione dei pulsanti della button

  • default: nil



16
17
18
# File 'app/concepts/lato_view/buttongroup/cell.rb', line 16

def size
  @size
end

#styleObject

Stile da utilizzare per la buttongroup

  • default: nil (normal)



20
21
22
# File 'app/concepts/lato_view/buttongroup/cell.rb', line 20

def style
  @style
end

Instance Method Details

#showObject



31
32
33
# File 'app/concepts/lato_view/buttongroup/cell.rb', line 31

def show
  render 'show.html'
end