Sha256: b893d3f524c6edf328c75380b50336ee7addebb3730e2abb18644d8181141a30

Contents?: true

Size: 670 Bytes

Versions: 61

Compression:

Stored size: 670 Bytes

Contents

module Celerity

  #
  # Mixed in to all elements that can have the 'disabled' attribute.
  #

  module DisabledElement
    include Celerity::Exception

    #
    # Returns false if the element is disabled.
    #

    def enabled?
      !disabled?
    end

    #
    # Returns true if the element is disabled.
    #

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

    #
    # Used internally.
    # @api private
    #

    def assert_enabled
      if disabled?
        raise ObjectDisabledException, "Object #{identifier_string} is disabled"
      end
    end

  end
end

Version data entries

61 entries across 61 versions & 11 rubygems

Version Path
oki-celerity-0.8.1 lib/celerity/disabled_element.rb
oki-celerity-0.8.1.dev lib/celerity/disabled_element.rb
celerity-0.8.0 lib/celerity/disabled_element.rb
celerity-0.8.0.beta.4 lib/celerity/disabled_element.rb
celerity-0.8.0.beta.3 lib/celerity/disabled_element.rb
celerity-0.8.0.beta.2 lib/celerity/disabled_element.rb
celerity-0.8.0.beta.1 lib/celerity/disabled_element.rb
fletcherm-culerity-0.2.9 vendor/gems/celerity-0.7.6/lib/celerity/disabled_element.rb
fletcherm-culerity-0.2.8 vendor/gems/celerity-0.7.6/lib/celerity/disabled_element.rb
celerity-0.7.9 lib/celerity/disabled_element.rb
celerity-0.7.8 lib/celerity/disabled_element.rb
fletcherm-culerity-0.2.7 vendor/gems/celerity-0.7.6/lib/celerity/disabled_element.rb
celerity-0.7.7 lib/celerity/disabled_element.rb
fletcherm-culerity-0.2.6 vendor/gems/celerity-0.7.6/lib/celerity/disabled_element.rb
fletcherm-culerity-0.2.5 vendor/gems/celerity-0.7.6/lib/celerity/disabled_element.rb
celerity-0.7.6 lib/celerity/disabled_element.rb
celerity-0.7.5 lib/celerity/disabled_element.rb
celerity-0.7.4 lib/celerity/disabled_element.rb
celerity-0.7.3 lib/celerity/disabled_element.rb
celerity-0.0.7.2 lib/celerity/disabled_element.rb