Class: BootstrapBuilders::Tab
- Inherits:
-
Object
- Object
- BootstrapBuilders::Tab
- Defined in:
- lib/bootstrap_builders/tab.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#ajax_url ⇒ Object
readonly
Returns the value of attribute ajax_url.
-
#container_html ⇒ Object
Returns the value of attribute container_html.
-
#container_id ⇒ Object
readonly
Returns the value of attribute container_id.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(args) ⇒ Tab
constructor
A new instance of Tab.
- #specific_id_given? ⇒ Boolean
Constructor Details
#initialize(args) ⇒ Tab
Returns a new instance of Tab.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bootstrap_builders/tab.rb', line 5 def initialize(args) @active = args[:active] @label = args.fetch(:label) @ajax_url = args[:ajax_url] if args[:container_id] @specific_id_given = true else @specific_id_given = false end @container_id = args[:container_id].presence @container_id ||= SecureRandom.hex end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
2 3 4 |
# File 'lib/bootstrap_builders/tab.rb', line 2 def active @active end |
#ajax_url ⇒ Object (readonly)
Returns the value of attribute ajax_url.
3 4 5 |
# File 'lib/bootstrap_builders/tab.rb', line 3 def ajax_url @ajax_url end |
#container_html ⇒ Object
Returns the value of attribute container_html.
2 3 4 |
# File 'lib/bootstrap_builders/tab.rb', line 2 def container_html @container_html end |
#container_id ⇒ Object (readonly)
Returns the value of attribute container_id.
3 4 5 |
# File 'lib/bootstrap_builders/tab.rb', line 3 def container_id @container_id end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
3 4 5 |
# File 'lib/bootstrap_builders/tab.rb', line 3 def label @label end |
Instance Method Details
#active? ⇒ Boolean
20 21 22 |
# File 'lib/bootstrap_builders/tab.rb', line 20 def active? @active end |
#specific_id_given? ⇒ Boolean
24 25 26 |
# File 'lib/bootstrap_builders/tab.rb', line 24 def specific_id_given? @specific_id_given end |