Module: Kookaburra::UIDriver::HasUIComponents

Included in:
Kookaburra::UIDriver, UIComponent
Defined in:
lib/kookaburra/ui_driver/has_ui_components.rb

Overview

Classes that can contain reerences to UIComponent instances (i.e. Kookaburra::UIDriver and UIComponent subclasses are extended by this module in order to set up those references. UIDriver and UIComponent are already extended, so you shouldn't need to do so elsewhere.

Instances of the extending class must define a #configuration method that returns the current Kookaburra::Configuration

Instance Method Summary collapse

Instance Method Details

#ui_component(component_name, component_class, options = {}) ⇒ Object

Tells the extending UIDriver or UIComponent about your UIComponent subclasses.

Parameters:

  • component_name (Symbol)

    Will create an instance method of this name that returns an instance of the component_class

  • component_class (Class)

    The UIComponent subclass that defines this component.

  • options (Hash) (defaults to: {})

    An extra options hash that will be passed to the UIComponent on initialization.



21
22
23
24
25
# File 'lib/kookaburra/ui_driver/has_ui_components.rb', line 21

def ui_component(component_name, component_class, options = {})
  define_method(component_name) do
    component_class.new(configuration, options)
  end
end