Module: Celerity::DisabledElement

Includes:
Celerity::Exception
Defined in:
lib/celerity/disabled_element.rb

Overview

Mixed in to all elements that can have the ‘disabled’ attribute.

Method Summary

Method Details

- (Object) assert_enabled

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

- (Object) disabled? 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

- (Object) enabled?

Returns false if the element is disabled.



14
15
16
# File 'lib/celerity/disabled_element.rb', line 14

def enabled?
  !disabled?
end