Class: Bs5::ExpandableList::GroupItemComponent

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

Constant Summary collapse

DEFAULT_WRAPPER_TAG =
:div
DEFAULT_TAG_NAME =
:div

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ GroupItemComponent

Returns a new instance of GroupItemComponent.



16
17
18
19
20
21
22
23
# File 'app/components/bs5/expandable_list/group_item_component.rb', line 16

def initialize(options = {})
  @parent_id = options.delete(:parent_id)
  @is_stretchable = options.delete(:stretchable)
  @is_expanded = options.delete(:expanded)
  @tag_name = options.delete(:tag) || DEFAULT_TAG_NAME
  @wrapper_html = options.delete(:wrapper_html)
  @options = options
end

Instance Attribute Details

#is_expandedObject (readonly) Also known as: expanded?

Returns the value of attribute is_expanded.



14
15
16
# File 'app/components/bs5/expandable_list/group_item_component.rb', line 14

def is_expanded
  @is_expanded
end

#is_stretchableObject (readonly) Also known as: stretchable?

Returns the value of attribute is_stretchable.



14
15
16
# File 'app/components/bs5/expandable_list/group_item_component.rb', line 14

def is_stretchable
  @is_stretchable
end

#optionsObject (readonly)

Returns the value of attribute options.



14
15
16
# File 'app/components/bs5/expandable_list/group_item_component.rb', line 14

def options
  @options
end

#parent_idObject (readonly)

Returns the value of attribute parent_id.



14
15
16
# File 'app/components/bs5/expandable_list/group_item_component.rb', line 14

def parent_id
  @parent_id
end

#tag_nameObject (readonly)

Returns the value of attribute tag_name.



14
15
16
# File 'app/components/bs5/expandable_list/group_item_component.rb', line 14

def tag_name
  @tag_name
end

#wrapper_htmlObject (readonly)

Returns the value of attribute wrapper_html.



14
15
16
# File 'app/components/bs5/expandable_list/group_item_component.rb', line 14

def wrapper_html
  @wrapper_html
end