Class: Templet::Links::BsBtnClass
- Inherits:
-
Struct
- Object
- Struct
- Templet::Links::BsBtnClass
- Includes:
- Constants
- Defined in:
- app/helpers/templet/links/bs_btn_class.rb,
lib/generators/templet/templates/core/templet/links/bs_btn_class.rb
Overview
For Bootstrap link/button HTML classes
Constant Summary
Constants included from Constants
Constants::BS_BUTTON, Constants::BS_BUTTON_BLOCK, Constants::BS_BUTTON_DROPDOWN, Constants::BS_BUTTON_GROUP, Constants::BS_BUTTON_GROUP_JUSTIFIED, Constants::BS_BUTTON_GROUP_VERTICAL, Constants::BS_BUTTON_SIZE, Constants::BS_BUTTON_SUBMIT, Constants::BS_BUTTON_SUBMIT_SEARCH, Constants::BS_BUTTON_TOOLBAR, Constants::BS_BUTTON_TYPE, Constants::BS_COL, Constants::BS_COL_OFFSET, Constants::BS_FORM, Constants::BS_FORM_INLINE, Constants::BS_LIST_GROUP, Constants::BS_LIST_GROUP_ITEM, Constants::BS_LIST_INLINE, Constants::BS_LIST_UNSTYLED, Constants::BS_NAV, Constants::BS_NAV_PILLS, Constants::BS_NAV_PILLS_STACKED, Constants::BS_NAV_TABS, Constants::BS_PANEL, Constants::BS_PANEL_BODY, Constants::BS_PANEL_HEADING, Constants::BS_PANEL_TITLE, Constants::BS_SELECTED, Constants::BS_TABLE, Constants::BS_TOOLBAR
Instance Attribute Summary collapse
-
#size ⇒ Object
Returns the value of attribute size.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#+(suffix) ⇒ Object
Allows compatibily with an HTML class specifield in a String.
- #call(type: type(), size: size()) ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#size ⇒ Object
Returns the value of attribute size
5 6 7 |
# File 'app/helpers/templet/links/bs_btn_class.rb', line 5 def size @size end |
#type ⇒ Object
Returns the value of attribute type
5 6 7 |
# File 'app/helpers/templet/links/bs_btn_class.rb', line 5 def type @type end |
Class Method Details
.call(html_class = nil) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/helpers/templet/links/bs_btn_class.rb', line 24 def call(html_class=nil) case html_class when String, self html_class when Symbol preset html_class when Array new *html_class else new end end |
.preset(name = nil) ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'app/helpers/templet/links/bs_btn_class.rb', line 37 def preset(name=nil) case name when :default new when :item Constants::BS_LIST_GROUP_ITEM else new name end end |
Instance Method Details
#+(suffix) ⇒ Object
Allows compatibily with an HTML class specifield in a String
17 18 19 20 21 |
# File 'app/helpers/templet/links/bs_btn_class.rb', line 17 def +(suffix) suffix = suffix.to_s call + (suffix.start_with?(' ') ? '' : ' ') + suffix end |