Module: Celerity::DisabledElement

Included Modules

Celerity::Exception

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

Public Visibility

Public Instance Method Summary

#assert_enabled

Used internally.

#disabled? #disabled

Returns true if the element is disabled.

#enabled?

Returns false if the element is disabled.

Public Instance Method Details

assert_enabled

public assert_enabled

Used internally.

Meta Tags

Parameters:

[View source]


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?

public disabled?

Also known as: disabled

Returns true if the element is disabled.

[View source]


22
23
24
25
# File 'lib/celerity/disabled_element.rb', line 22

def disabled?
  assert_exists unless defined?(@object) && @object
  @object.isDisabled
end

enabled?

public enabled?

Returns false if the element is disabled.

[View source]


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

def enabled?
  !disabled?
end