Class: NfgUi::Components::Patterns::TileBody

Inherits:
Base show all
Includes:
Utilities::Iconable
Defined in:
lib/nfg_ui/components/patterns/tile_body.rb

Overview

TileBody doc coming soon

Constant Summary

Constants included from Traits

Traits::REGISTERED_TRAITS, Traits::TRAIT_MODULES

Instance Attribute Summary

Attributes inherited from Bootstrap::Components::Base

#body, #options, #view_context

Instance Method Summary collapse

Methods included from Utilities::Iconable

#icon

Methods included from Utilities::Traitable

#traits, #utility_initialize

Methods included from Utilities::Renderable

#render_if, #render_unless

Methods included from Utilities::Describable

#data, #describe

Methods inherited from Bootstrap::Components::Base

#data, #href, #html_options, #id, #initialize, #style

Constructor Details

This class inherits a constructor from NfgUi::Bootstrap::Components::Base

Instance Method Details

#component_familyObject



14
15
16
# File 'lib/nfg_ui/components/patterns/tile_body.rb', line 14

def component_family
  :tile
end

#headingObject



10
11
12
# File 'lib/nfg_ui/components/patterns/tile_body.rb', line 10

def heading
  options.fetch(:heading, nil)
end

#renderObject



18
19
20
21
22
23
24
25
# File 'lib/nfg_ui/components/patterns/tile_body.rb', line 18

def render
  super do
    if heading
      concat(NfgUi::Components::Foundations::Typeface.new({ heading: heading, icon: icon }, view_context).render)
    end
    concat((block_given? ? yield : body))
  end
end