module NfgUi::Bootstrap::Utilities::Collapsible

Allows components to carry collapse attributes to more easily pass collapse status to a collapsible target

Example: Tile & TileHeader both include Collapsible because they both pass collapse attributes to a collapse button within TileHeader

They do not, however need a collapse toggle unlike a NavbarToggle / Button, and thus they do not include The CollapseToggleable module

CollapseToggleable components have this module included by default via the CollapseToggleable module.

Public Instance Methods

collapse() click to toggle source
# File lib/nfg_ui/bootstrap/utilities/collapsible.rb, line 21
def collapse
  options.fetch(:collapse, nil)
end
collapsed() click to toggle source
# File lib/nfg_ui/bootstrap/utilities/collapsible.rb, line 25
def collapsed
  options.fetch(:collapsed, nil)
end
collapsible() click to toggle source

Collapsible checks if collapse is manually set true or false and thus, collapsible

# File lib/nfg_ui/bootstrap/utilities/collapsible.rb, line 30
def collapsible
  options[:collapsible] || collapse || !collapsed.nil?
end

Private Instance Methods

non_html_attribute_options() click to toggle source
Calls superclass method
# File lib/nfg_ui/bootstrap/utilities/collapsible.rb, line 36
def non_html_attribute_options
  super.push(:collapse, :collapsed, :collapsible)
end