Class: Satis::Tab::Component

Inherits:
ApplicationComponent show all
Defined in:
app/components/satis/tab/component.rb

Instance Attribute Summary collapse

Attributes inherited from ApplicationComponent

#original_view_context

Instance Method Summary collapse

Methods inherited from ApplicationComponent

add_helper, #component_name, #ct, #i18n_scope, #original_i18n_scope, #original_virtual_path

Constructor Details

#initialize(name, *args, &block) ⇒ Component

Returns a new instance of Component.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/components/satis/tab/component.rb', line 8

def initialize(name, *args, &block)
  super
  @name = name
  @options = args.extract_options!
  @args = args
  @icon = options[:icon]
  @id = options[:id]
  @badge = options[:badge]
  @tab_menu = options[:tab_menu]
  @block = block
  @selected_tab_index = options[:selected_tab_index]
end

Instance Attribute Details

#badgeObject (readonly)

Returns the value of attribute badge.



6
7
8
# File 'app/components/satis/tab/component.rb', line 6

def badge
  @badge
end

#iconObject (readonly)

Returns the value of attribute icon.



6
7
8
# File 'app/components/satis/tab/component.rb', line 6

def icon
  @icon
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'app/components/satis/tab/component.rb', line 6

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'app/components/satis/tab/component.rb', line 6

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'app/components/satis/tab/component.rb', line 6

def options
  @options
end

#selected_tab_indexObject (readonly)

Returns the value of attribute selected_tab_index.



6
7
8
# File 'app/components/satis/tab/component.rb', line 6

def selected_tab_index
  @selected_tab_index
end

#tab_menuObject (readonly)

Returns the value of attribute tab_menu.



6
7
8
# File 'app/components/satis/tab/component.rb', line 6

def tab_menu
  @tab_menu
end

Instance Method Details

#callObject



33
34
35
# File 'app/components/satis/tab/component.rb', line 33

def call
  content
end

#responsive?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/components/satis/tab/component.rb', line 21

def responsive?
  options[:responsive] == true
end

#selected?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/components/satis/tab/component.rb', line 25

def selected?
  options[:selected] == true
end

#titleObject



29
30
31
# File 'app/components/satis/tab/component.rb', line 29

def title
  options[:title]
end