Sha256: 1ab7cefc6f6667b2a6f5053671e240c9ecf6fedcb914ba626fbc8d840594070e

Contents?: true

Size: 958 Bytes

Versions: 8

Compression:

Stored size: 958 Bytes

Contents

module Vedeu

  module Null

    # Provides a non-existent model to swallow messages.
    #
    # @api private
    class Interface

      # @param name [String]
      # @return [Vedeu::Null::Interface]
      def initialize(name = nil)
        @name = name
      end

      # @return [Hash<Symbol => String>]
      def attributes
        {
          name: name,
        }
      end

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

      # The null interface should not be visible.
      #
      # @return [FalseClass]
      def visible?
        false
      end

      # Override the visible= setter usually found on a Vedeu::Interface.
      #
      # @return [FalseClass]
      def visible=(*)
        false
      end

      protected

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

    end # Interface

  end # Null

end # Vedeu

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vedeu-0.4.40 lib/vedeu/null/interface.rb
vedeu-0.4.39 lib/vedeu/null/interface.rb
vedeu-0.4.38 lib/vedeu/null/interface.rb
vedeu-0.4.37 lib/vedeu/null/interface.rb
vedeu-0.4.36 lib/vedeu/null/interface.rb
vedeu-0.4.35 lib/vedeu/null/interface.rb
vedeu-0.4.34 lib/vedeu/null/interface.rb
vedeu-0.4.33 lib/vedeu/null/interface.rb