Module: Dill::DSL

Defined in:
lib/dill/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#widget_lookup_scopeObject



24
25
26
# File 'lib/dill/dsl.rb', line 24

def widget_lookup_scope
  @widget_lookup_scope ||= default_widget_lookup_scope
end

Instance Method Details

#documentDocument

Returns the current document with the class of the current object set as the widget lookup scope.

Returns:

  • (Document)

    the current document with the class of the current object set as the widget lookup scope.



7
8
9
# File 'lib/dill/dsl.rb', line 7

def document
  Document.new(widget_lookup_scope: widget_lookup_scope)
end

#has_widget?(name) ⇒ Boolean

Returns Whether one or more widgets exist in the current document.

Returns:

  • (Boolean)

    Whether one or more widgets exist in the current document.



13
14
15
# File 'lib/dill/dsl.rb', line 13

def has_widget?(name)
  document.has_widget?(name)
end

#widget(name, options = {}) ⇒ Object

Returns a widget instance for the given name.

Parameters:

  • name (String, Symbol)


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

def widget(name, options = {})
  document.widget(name, options)
end