Class: Css3buttons::ButtonGroup
- Inherits:
-
Object
- Object
- Css3buttons::ButtonGroup
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/css3buttons/button_group.rb
Instance Attribute Summary collapse
-
#button_count ⇒ Object
readonly
Returns the value of attribute button_count.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize(template, options) ⇒ ButtonGroup
constructor
A new instance of ButtonGroup.
- #render(&block) ⇒ Object
Constructor Details
#initialize(template, options) ⇒ ButtonGroup
Returns a new instance of ButtonGroup.
6 7 8 9 10 11 |
# File 'lib/css3buttons/button_group.rb', line 6 def initialize(template, ) @button_count = 0 @template = template @options = @options[:wrapper_tag] ||= :div end |
Instance Attribute Details
#button_count ⇒ Object (readonly)
Returns the value of attribute button_count.
4 5 6 |
# File 'lib/css3buttons/button_group.rb', line 4 def @button_count end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/css3buttons/button_group.rb', line 4 def @options end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
4 5 6 |
# File 'lib/css3buttons/button_group.rb', line 4 def template @template end |
Instance Method Details
#render(&block) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/css3buttons/button_group.rb', line 13 def render(&block) = @options.clone .delete(:wrapper_tag) .delete(:minor) [:class] ||= '' [:class] = ([:class].split(" ") + ['button-group']).join(" ") [:class] = ([:class].split(" ") + ['minor-group']).join(" ") if @options[:minor] content_tag(@options[:wrapper_tag], @template.capture(&block), ) if block_given? end |