Sha256: bb68b30604d377ab42e576f24b0617a88be34233f0a1d553e023aba0c6a5cccc
Contents?: true
Size: 841 Bytes
Versions: 17
Compression:
Stored size: 841 Bytes
Contents
require_dependency 'faalis/dashboard/models/sidebar' module Faalis::Dashboard::Sections module Sidebar extend ActiveSupport::Concern protected def setup_sidebar @sidebar = sidebar(t('dashboard')) do |sidebar| sidebar.faalis_entries end end private def sidebar(name, **options, &block) sidebar = Faalis::Dashboard::Models::Sidebar.new(name, **options) yield sidebar if block_given? sidebar end module ClassMethods def sidebar(name, **options, &block) side = Faalis::Dashboard::Models::Sidebar.new(name, **options) side.instance_eval do block.call if block_given? end define_method(:setup_sidebar) do instance_variable_set('@sidebar', side) end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems