Class: BootstrapBuilders::Tab

Inherits:
Object
  • Object
show all
Defined in:
lib/bootstrap_builders/tab.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#activeObject

Returns the value of attribute active.



2
3
4
# File 'lib/bootstrap_builders/tab.rb', line 2

def active
  @active
end

#ajax_urlObject (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_htmlObject

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_idObject (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

#labelObject (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

Returns:

  • (Boolean)


20
21
22
# File 'lib/bootstrap_builders/tab.rb', line 20

def active?
  @active
end

#specific_id_given?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/bootstrap_builders/tab.rb', line 24

def specific_id_given?
  @specific_id_given
end