Module: Celerity::DisabledElement
Overview
Mixed in to all elements that can have the ‘disabled’ attribute.
Instance Method Summary collapse
-
#assert_enabled ⇒ Object
private
Used internally.
-
#disabled? ⇒ Boolean
(also: #disabled)
Returns true if the element is disabled.
-
#enabled? ⇒ Boolean
Returns false if the element is disabled.
Instance Method Details
#assert_enabled ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Used internally.
33 34 35 36 37 |
# File 'lib/celerity/disabled_element.rb', line 33 def assert_enabled if disabled? raise ObjectDisabledException, "Object #{identifier_string} is disabled" end end |
#disabled? ⇒ Boolean Also known as: disabled
Returns true if the element is disabled.
22 23 24 25 |
# File 'lib/celerity/disabled_element.rb', line 22 def disabled? assert_exists unless defined?(@object) && @object @object.isDisabled end |
#enabled? ⇒ Boolean
Returns false if the element is disabled.
14 15 16 |
# File 'lib/celerity/disabled_element.rb', line 14 def enabled? !disabled? end |