Sha256: 55c39ea1043b223fda65bf2ccbb564a4775d400d1c0436badf25cc913da17faf

Contents?: true

Size: 880 Bytes

Versions: 18

Compression:

Stored size: 880 Bytes

Contents

module Vedeu

  # Home of various runtime flags which Vedeu uses.
  #
  class Flags

    include Singleton

    class << self

      # @return [Boolean]
      def ready!
        instance.options[:ready] = true
      end

      # @return [Boolean]
      def ready?
        instance.options[:ready]
      end

      # Reset the flags to the default values.
      #
      # @return [Hash]
      def reset!
        instance.reset!
      end

    end # Eigenclass

    # @!attribute [rw]
    # @return [Hash]
    attr_accessor :options

    # Create a new singleton instance of Vedeu::Flags.
    #
    # @return [Vedeu::Flags]
    def initialize
      self.options = defaults
    end

    # @return [Hash]
    def reset!
      self.options = defaults
    end

    private

    # @return [Hash]
    def defaults
      {
        ready: false,
      }
    end

  end # Flags

end # Vedeu

Version data entries

18 entries across 18 versions & 1 rubygems

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