Class: Bs5::ExpandableList::GroupComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/bs5/expandable_list/group_component.rb

Constant Summary collapse

DEFAULT_TAG_NAME =
:div

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ GroupComponent

Returns a new instance of GroupComponent.



15
16
17
18
19
20
21
# File 'app/components/bs5/expandable_list/group_component.rb', line 15

def initialize(options = {})
  @is_accordion = options.delete(:accordion)
  @is_stretchable = options.delete(:stretchable)
  @id = options.delete(:id)
  @tag_name = options.delete(:tag) || DEFAULT_TAG_NAME
  @options = options
end

Instance Attribute Details

#is_accordionObject (readonly) Also known as: accordion?

Returns the value of attribute is_accordion.



11
12
13
# File 'app/components/bs5/expandable_list/group_component.rb', line 11

def is_accordion
  @is_accordion
end

#is_stretchableObject (readonly) Also known as: stretchable?

Returns the value of attribute is_stretchable.



11
12
13
# File 'app/components/bs5/expandable_list/group_component.rb', line 11

def is_stretchable
  @is_stretchable
end

#optionsObject (readonly)

Returns the value of attribute options.



11
12
13
# File 'app/components/bs5/expandable_list/group_component.rb', line 11

def options
  @options
end

#tag_nameObject (readonly)

Returns the value of attribute tag_name.



11
12
13
# File 'app/components/bs5/expandable_list/group_component.rb', line 11

def tag_name
  @tag_name
end