Sha256: c18c218b0c94d662fd97e50e975647cc69f1f21ad01bcaf4f423255afb6a8ae2

Contents?: true

Size: 1 KB

Versions: 5

Compression:

Stored size: 1 KB

Contents

module Vedeu

  module Null

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

      # Returns a new instance of Vedeu::Null::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

5 entries across 5 versions & 1 rubygems

Version Path
vedeu-0.4.45 lib/vedeu/null/interface.rb
vedeu-0.4.44 lib/vedeu/null/interface.rb
vedeu-0.4.43 lib/vedeu/null/interface.rb
vedeu-0.4.42 lib/vedeu/null/interface.rb
vedeu-0.4.41 lib/vedeu/null/interface.rb