Module: Voom::Presenters::DSL

Extended by:
Trace
Defined in:
lib/voom/presenters/dsl.rb,
lib/voom/presenters/dsl/definer.rb,
lib/voom/presenters/dsl/lockable.rb,
lib/voom/presenters/dsl/definition.rb,
lib/voom/presenters/dsl/user_interface.rb,
lib/voom/presenters/dsl/components/base.rb,
lib/voom/presenters/dsl/components/card.rb,
lib/voom/presenters/dsl/components/chip.rb,
lib/voom/presenters/dsl/components/form.rb,
lib/voom/presenters/dsl/components/grid.rb,
lib/voom/presenters/dsl/components/icon.rb,
lib/voom/presenters/dsl/components/list.rb,
lib/voom/presenters/dsl/components/menu.rb,
lib/voom/presenters/dsl/components/page.rb,
lib/voom/presenters/dsl/components/badge.rb,
lib/voom/presenters/dsl/components/event.rb,
lib/voom/presenters/dsl/components/image.rb,
lib/voom/presenters/dsl/components/input.rb,
lib/voom/presenters/dsl/components/table.rb,
lib/voom/presenters/dsl/components/action.rb,
lib/voom/presenters/dsl/components/avatar.rb,
lib/voom/presenters/dsl/components/button.rb,
lib/voom/presenters/dsl/components/dialog.rb,
lib/voom/presenters/dsl/components/drawer.rb,
lib/voom/presenters/dsl/components/footer.rb,
lib/voom/presenters/dsl/components/header.rb,
lib/voom/presenters/dsl/components/select.rb,
lib/voom/presenters/dsl/components/switch.rb,
lib/voom/presenters/dsl/invalid_presenter.rb,
lib/voom/presenters/dsl/components/content.rb,
lib/voom/presenters/dsl/components/tooltip.rb,
lib/voom/presenters/dsl/components/checkbox.rb,
lib/voom/presenters/dsl/components/snackbar.rb,
lib/voom/presenters/dsl/components/icon_base.rb,
lib/voom/presenters/dsl/components/text_area.rb,
lib/voom/presenters/dsl/components/date_field.rb,
lib/voom/presenters/dsl/components/event_base.rb,
lib/voom/presenters/dsl/components/lists/line.rb,
lib/voom/presenters/dsl/components/text_field.rb,
lib/voom/presenters/dsl/components/time_field.rb,
lib/voom/presenters/dsl/components/typography.rb,
lib/voom/presenters/dsl/components/icon_toggle.rb,
lib/voom/presenters/dsl/components/toggle_base.rb,
lib/voom/presenters/dsl/components/hidden_field.rb,
lib/voom/presenters/dsl/components/lists/action.rb,
lib/voom/presenters/dsl/components/mixins/chips.rb,
lib/voom/presenters/dsl/components/mixins/event.rb,
lib/voom/presenters/dsl/components/mixins/grids.rb,
lib/voom/presenters/dsl/components/mixins/icons.rb,
lib/voom/presenters/dsl/components/mixins/menus.rb,
lib/voom/presenters/dsl/components/radio_button.rb,
lib/voom/presenters/dsl/components/datetime_base.rb,
lib/voom/presenters/dsl/components/mixins/append.rb,
lib/voom/presenters/dsl/components/mixins/avatar.rb,
lib/voom/presenters/dsl/components/mixins/common.rb,
lib/voom/presenters/dsl/components/mixins/images.rb,
lib/voom/presenters/dsl/components/datetime_field.rb,
lib/voom/presenters/dsl/components/mixins/buttons.rb,
lib/voom/presenters/dsl/components/mixins/content.rb,
lib/voom/presenters/dsl/components/mixins/dialogs.rb,
lib/voom/presenters/dsl/components/mixins/helpers.rb,
lib/voom/presenters/dsl/components/mixins/selects.rb,
lib/voom/presenters/dsl/components/mixins/toggles.rb,
lib/voom/presenters/dsl/components/expansion_panel.rb,
lib/voom/presenters/dsl/components/lists/separator.rb,
lib/voom/presenters/dsl/components/mixins/attaches.rb,
lib/voom/presenters/dsl/components/mixins/tooltips.rb,
lib/voom/presenters/dsl/components/mixins/yield_to.rb,
lib/voom/presenters/dsl/components/mixins/snackbars.rb,
lib/voom/presenters/dsl/components/mixins/typography.rb,
lib/voom/presenters/dsl/components/mixins/text_fields.rb,
lib/voom/presenters/dsl/components/mixins/date_time_fields.rb,
lib/voom/presenters/dsl/components/mixins/expansion_panels.rb

Defined Under Namespace

Modules: Components, Definer, Lockable Classes: Definition, InvalidPresenter, UserInterface

Class Method Summary collapse

Class Method Details

.define(name, &block) ⇒ Object



20
21
22
# File 'lib/voom/presenters/dsl.rb', line 20

def self.define(name, &block)
  registry[name] = Voom::Presenters::DSL::Definition.new(&block)
end

.finalizeObject



31
32
33
34
35
36
37
38
39
40
# File 'lib/voom/presenters/dsl.rb', line 31

def self.finalize
  registry.each do |key, definition|
    begin
      register(key, build(definition))
    rescue Exception => e
      logger.error {"Failed to load presenter #{key}: #{e.inspect}."}
      raise e
    end
  end
end

.load(directory) ⇒ Object



24
25
26
27
28
29
# File 'lib/voom/presenters/dsl.rb', line 24

def self.load(directory)
  files = File.join(directory, '**', '*.pom')
  Dir.glob(files) do |file|
    Kernel.load file
  end
end

.registryObject



16
17
18
# File 'lib/voom/presenters/dsl.rb', line 16

def self.registry
  @registry
end

.reset!Object

This method empties out the dsl definitions It should ONLY be used for testing purposes



44
45
46
# File 'lib/voom/presenters/dsl.rb', line 44

def self.reset!
  registry.clear
end