Class: Bulma::ButtonComponent
- Defined in:
- app/components/bulma/button_component.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #classes ⇒ Object
-
#initialize(value = nil, type: "submit", size: nil, color: nil, light: false, fullwidth: false, loading: false) ⇒ ButtonComponent
constructor
A new instance of ButtonComponent.
Constructor Details
#initialize(value = nil, type: "submit", size: nil, color: nil, light: false, fullwidth: false, loading: false) ⇒ ButtonComponent
Returns a new instance of ButtonComponent.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/components/bulma/button_component.rb', line 7 def initialize( value = nil, type: "submit", size: nil, color: nil, light: false, fullwidth: false, loading: false ) @value = value @type = type @size = size @color = color @light = light @fullwidth = fullwidth @loading = loading end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'app/components/bulma/button_component.rb', line 5 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'app/components/bulma/button_component.rb', line 5 def value @value end |
Instance Method Details
#classes ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'app/components/bulma/button_component.rb', line 25 def classes class_names( "button", "is-#{@size}" => @size, "is-light" => @light, "is-#{@color}" => @color.present?, "is-fullwidth" => @fullwidth, "is-loading" => @loading ) end |