Module: Dill::WidgetParts::Container

Includes:
Dill
Included in:
Document, Dill::Widget
Defined in:
lib/dill/widgets/parts/container.rb

Constant Summary

Constants included from Dill

VERSION

Instance Method Summary collapse

Methods included from Dill

#deprecate

Methods included from Constructors

#Decimal, #Integer, #Widget

Instance Method Details

#has_widget?(name, *args) ⇒ Boolean Also known as: widget?

Returns:

  • (Boolean)


6
7
8
9
# File 'lib/dill/widgets/parts/container.rb', line 6

def has_widget?(name, *args)
  deprecate('has_widget? and its alias widget?', 'visible?')
  widget_class(name).present_in?(self, *args)
end

#not_visible?(name, *args) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/dill/widgets/parts/container.rb', line 17

def not_visible?(name, *args)
  widget_class(name).not_present_in?(self, *args)
end

#visible?(name, *args) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/dill/widgets/parts/container.rb', line 13

def visible?(name, *args)
  widget_class(name).present_in?(self, *args)
end

#widget(name, *args) ⇒ Object



21
22
23
24
25
# File 'lib/dill/widgets/parts/container.rb', line 21

def widget(name, *args)
  first, rest = [*name, *args]

  widget_class(first).find_in(self, *rest)
end

#widgets(name, *args) ⇒ Object



27
28
29
30
31
# File 'lib/dill/widgets/parts/container.rb', line 27

def widgets(name, *args)
  first, rest = [*name, *args]

  widget_class(first).find_all_in(self, *rest)
end