Class: Ui::Display

Inherits:
ActionView::Base
  • Object
show all
Includes:
Singleton, ViewComponent
Defined in:
lib/rapid_ui/display.rb

Instance Method Summary collapse

Constructor Details

#initializeDisplay

Returns a new instance of Display.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rapid_ui/display.rb', line 8

def initialize
  RapidUi.configuration.ui_yml['ui'].each do |ui_element|
    define_singleton_method ui_element[0].to_s do |args = {}|
      # for convenience we allow people to only pass a class string
      # it is the same as setting a class
      args = { class: args } if args.is_a?(String)

      WrapperComponent.new(ui_element[0].to_sym, args)
    end
  end
end