Class: Input::Checkbox::Cell

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

Constant Summary collapse

@@widths =
VIEW_INPUTWIDTH

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: 'input', placeholder: '', value: '', label: '', width: 'large', required: false, disabled: false, custom_class: '', unique_id: '') ⇒ Cell

NB: The unique_id is used to use more checkbox with same name on same page.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/cells/lato_view/input/checkbox/cell.rb', line 11

def initialize(name: 'input', placeholder: '', value: '', label: '',
               width: 'large', required: false, disabled: false, custom_class: '' ,
               unique_id: '')
  # save params
  @name = name
  @placeholder = placeholder
  @value = value
  @label = label
  @width = width
  @required = required
  @disabled = disabled
  @custom_class = custom_class
  @unique_id = unique_id
  # check params
  check_params
end

Instance Attribute Details

#disabledObject

Returns the value of attribute disabled.



6
7
8
# File 'app/cells/lato_view/input/checkbox/cell.rb', line 6

def disabled
  @disabled
end

#labelObject

Returns the value of attribute label.



6
7
8
# File 'app/cells/lato_view/input/checkbox/cell.rb', line 6

def label
  @label
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'app/cells/lato_view/input/checkbox/cell.rb', line 6

def name
  @name
end

#placeholderObject

Returns the value of attribute placeholder.



6
7
8
# File 'app/cells/lato_view/input/checkbox/cell.rb', line 6

def placeholder
  @placeholder
end

#requiredObject

Returns the value of attribute required.



6
7
8
# File 'app/cells/lato_view/input/checkbox/cell.rb', line 6

def required
  @required
end

#unique_idObject

Returns the value of attribute unique_id.



6
7
8
# File 'app/cells/lato_view/input/checkbox/cell.rb', line 6

def unique_id
  @unique_id
end

#valueObject

Returns the value of attribute value.



6
7
8
# File 'app/cells/lato_view/input/checkbox/cell.rb', line 6

def value
  @value
end

#widthObject

Returns the value of attribute width.



6
7
8
# File 'app/cells/lato_view/input/checkbox/cell.rb', line 6

def width
  @width
end

Instance Method Details

#showObject



28
29
30
# File 'app/cells/lato_view/input/checkbox/cell.rb', line 28

def show
  render "show.html"
end