Sha256: 3b0abfb23ba0fb8d648e05f187112a013e20edec53c07bc2b8f0ce61a0a2c976

Contents?: true

Size: 1.17 KB

Versions: 14

Compression:

Stored size: 1.17 KB

Contents

require 'vedeu/output/presentation'

module Vedeu

  module Null

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

      include Vedeu::Presentation

      # @!attribute [r] name,
      # @return [String]
      attr_reader :name

      # @!attribute [r] attributes
      # @return [String]
      attr_reader :attributes

      # @!attribute [rw] visible
      # @return [String]
      attr_accessor :visible
      alias_method :visible?, :visible

      # Returns a new instance of Vedeu::Null::View.
      #
      # @param attributes [Hash<Symbol => void>]
      # @option attributes name [String]
      # @return [Vedeu::Null::View]
      def initialize(attributes = {})
        @attributes = attributes
        @name       = @attributes[:name]
        @visible    = false
      end

      # @return [NilClass]
      def null
        nil
      end
      alias_method :parent, :null
      alias_method :zindex, :null

      # @return [Boolean]
      def null?
        true
      end

      # Pretend to store this model in the repository.
      #
      # @return [Vedeu::Null::View]
      def store
        self
      end

    end # View

  end # Null

end # Vedeu

Version data entries

14 entries across 14 versions & 1 rubygems

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