Class: Vedeu::Runtime::Flags Private

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/vedeu/runtime/flags.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Home of various runtime flags which Vedeu uses.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeVedeu::Runtime::Flags

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create a new singleton instance of Vedeu::Runtime::Flags.



46
47
48
# File 'lib/vedeu/runtime/flags.rb', line 46

def initialize
  self.options = defaults
end

Instance Attribute Details

#optionsHash

Returns:

  • (Hash)


41
42
43
# File 'lib/vedeu/runtime/flags.rb', line 41

def options
  @options
end

Class Method Details

.ready!Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



18
19
20
21
22
# File 'lib/vedeu/runtime/flags.rb', line 18

def ready!
  Vedeu.log(message: 'Vedeu ready!')

  instance.options[:ready] = true
end

.ready?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:



25
26
27
# File 'lib/vedeu/runtime/flags.rb', line 25

def ready?
  instance.options[:ready]
end

.resetHash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Reset the flags to the default values.

Returns:

  • (Hash)


35
36
37
# File 'lib/vedeu/runtime/flags.rb', line 35

def reset!
  instance.reset!
end

.reset!Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Reset the flags to the default values.

Returns:

  • (Hash)


32
33
34
# File 'lib/vedeu/runtime/flags.rb', line 32

def reset!
  instance.reset!
end

Instance Method Details

#defaultsHash<Symbol => void> (private)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The default options/attributes for a new instance of this class.

Returns:

  • (Hash<Symbol => void>)


59
60
61
62
63
# File 'lib/vedeu/runtime/flags.rb', line 59

def defaults
  {
    ready: false,
  }
end

#reset!Hash Also known as: reset

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Hash)


51
52
53
# File 'lib/vedeu/runtime/flags.rb', line 51

def reset!
  self.options = defaults
end