Class: Component::Button::Cell

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

Constant Summary collapse

@@colors =
%w(normal yellow green red)
@@sizes =
%w(normal small)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title: '', url: '', color: 'normal', size: 'normal', custom_class: '', method: 'get') ⇒ Cell

Returns a new instance of Cell.



9
10
11
12
13
14
15
16
17
18
19
# File 'app/cells/lato_view/component/button/cell.rb', line 9

def initialize(title: '', url: '', color: 'normal', size: 'normal', custom_class: '', method: 'get')
 # save params
  @title = title
  @url = url
  @color = color
  @size = size
  @method = method
  @custom_class = custom_class
  # check params
  check_params
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



7
8
9
# File 'app/cells/lato_view/component/button/cell.rb', line 7

def color
  @color
end

#custom_classObject

Returns the value of attribute custom_class.



7
8
9
# File 'app/cells/lato_view/component/button/cell.rb', line 7

def custom_class
  @custom_class
end

#methodObject

Returns the value of attribute method.



7
8
9
# File 'app/cells/lato_view/component/button/cell.rb', line 7

def method
  @method
end

#sizeObject

Returns the value of attribute size.



7
8
9
# File 'app/cells/lato_view/component/button/cell.rb', line 7

def size
  @size
end

#titleObject

Returns the value of attribute title.



7
8
9
# File 'app/cells/lato_view/component/button/cell.rb', line 7

def title
  @title
end

#urlObject

Returns the value of attribute url.



7
8
9
# File 'app/cells/lato_view/component/button/cell.rb', line 7

def url
  @url
end

Instance Method Details

#showObject



21
22
23
# File 'app/cells/lato_view/component/button/cell.rb', line 21

def show
  render 'show.html'
end