Class: Vedeu::Runtime::Flags

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

Overview

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

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



44
45
46
# File 'lib/vedeu/runtime/flags.rb', line 44

def initialize
  self.options = defaults
end

Instance Attribute Details

#optionsHash

Returns:

  • (Hash)


39
40
41
# File 'lib/vedeu/runtime/flags.rb', line 39

def options
  @options
end

Class Method Details

.ready!Boolean

Returns:



16
17
18
19
20
# File 'lib/vedeu/runtime/flags.rb', line 16

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

  instance.options[:ready] = true
end

.ready?Boolean

Returns:



23
24
25
# File 'lib/vedeu/runtime/flags.rb', line 23

def ready?
  instance.options[:ready]
end

.resetHash

Reset the flags to the default values.

Returns:

  • (Hash)


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

def reset!
  instance.reset!
end

.reset!Hash

Reset the flags to the default values.

Returns:

  • (Hash)


30
31
32
# File 'lib/vedeu/runtime/flags.rb', line 30

def reset!
  instance.reset!
end

Instance Method Details

#defaultsHash (private)

Returns:

  • (Hash)


57
58
59
60
61
# File 'lib/vedeu/runtime/flags.rb', line 57

def defaults
  {
    ready: false,
  }
end

#reset!Hash Also known as: reset

Returns:

  • (Hash)


49
50
51
# File 'lib/vedeu/runtime/flags.rb', line 49

def reset!
  self.options = defaults
end