Sha256: 3017713ef8dc80945f9a348d66a4ffc53a68808a260c7f1f873bf1a2aacb85cd

Contents?: true

Size: 1.05 KB

Versions: 17

Compression:

Stored size: 1.05 KB

Contents

module Vedeu

  module Null

    # Provides a non-existent model to swallow messages.
    #
    class Generic

      # Returns an instance of the Vedeu::Null::Generic class.
      #
      # @param attributes [Hash<Symbol => void>]
      # @option attributes name [String|NilClass]
      # @return [Vedeu::Null::Generic]
      def initialize(attributes = {})
        @attributes = attributes
        @name       = @attributes[:name]
      end

      # @return [NilClass]
      def null(*)
        nil
      end
      alias_method :add, :null
      alias_method :colour, :null
      alias_method :parent, :null
      alias_method :style, :null

      # @return [Boolean]
      def null?
        true
      end

      # @return [Vedeu::Null::Generic]
      def store
        self
      end

      # The generic null should not be visible.
      #
      # @return [FalseClass]
      def visible?
        false
      end
      alias_method :visible, :visible?

      # @return [FalseClass]
      def visible=(*)
        false
      end

    end # Generic

  end # Null

end # Vedeu

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
vedeu-0.6.6 lib/vedeu/null/generic.rb
vedeu-0.6.5 lib/vedeu/null/generic.rb
vedeu-0.6.4 lib/vedeu/null/generic.rb
vedeu-0.6.3 lib/vedeu/null/generic.rb
vedeu-0.6.2 lib/vedeu/null/generic.rb
vedeu-0.6.1 lib/vedeu/null/generic.rb
vedeu-0.6.0 lib/vedeu/null/generic.rb
vedeu-0.5.13 lib/vedeu/null/generic.rb
vedeu-0.5.12 lib/vedeu/null/generic.rb
vedeu-0.5.11 lib/vedeu/null/generic.rb
vedeu-0.5.10 lib/vedeu/null/generic.rb
vedeu-0.5.9 lib/vedeu/null/generic.rb
vedeu-0.5.8 lib/vedeu/null/generic.rb
vedeu-0.5.7 lib/vedeu/null/generic.rb
vedeu-0.5.6 lib/vedeu/null/generic.rb
vedeu-0.5.5 lib/vedeu/null/generic.rb
vedeu-0.5.4 lib/vedeu/null/generic.rb