Module: Faalis::Dashboard::Sections::Sidebar::ClassMethods

Defined in:
lib/faalis/dashboard/sections/sidebar.rb

Instance Method Summary collapse

Instance Method Details



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/faalis/dashboard/sections/sidebar.rb', line 28

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