Class: SmartCore::Initializer::Settings::StrictOptions Private

Inherits:
Base
  • Object
show all
Defined in:
lib/smart_core/initializer/settings/strict_options.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.

Since:

  • 0.8.0

Version:

  • 0.10.0

Instance Method Summary collapse

Methods inherited from Base

#dup, #initialize

Constructor Details

This class inherits a constructor from SmartCore::Initializer::Settings::Base

Instance Method Details

#assign(value) ⇒ void

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.

This method returns an undefined value.

Parameters:

  • value (Boolean)

Since:

  • 0.8.0

Version:

  • 0.10.0



24
25
26
27
28
29
30
31
32
33
# File 'lib/smart_core/initializer/settings/strict_options.rb', line 24

def assign(value)
  @lock.write_sync do
    raise(
      SmartCore::Initializer::SettingArgumentError,
      ":strict_options setting should be a type of boolean (got: `#{value.class}`)"
    ) unless value.is_a?(::TrueClass) || value.is_a?(::FalseClass)

    @value = value
  end
end

#resolveBoolean

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:

  • (Boolean)

Since:

  • 0.8.0

Version:

  • 0.10.0



12
13
14
15
16
# File 'lib/smart_core/initializer/settings/strict_options.rb', line 12

def resolve
  @lock.read_sync do
    (@value == nil) ? SmartCore::Initializer::Configuration[:strict_options] : @value
  end
end