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

#ct, #i18n_scope, #original_i18n_scope, #original_virtual_path

Constructor Details

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



8
9
10
11
12
13
14
15
16
# 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]
  @badge = options[:badge]
  @block = block
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

#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

Instance Method Details

#callObject



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

def call
  content
end

#responsive?Boolean



18
19
20
# File 'app/components/satis/tab/component.rb', line 18

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

#selected?Boolean



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

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

#titleObject



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

def title
  options[:title]
end