Module: Lich::Common::CharSettings Private
- Defined in:
- documented/common/settings/charsettings.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
-
.[](name) ⇒ OpenStruct
private
Retrieves a scoped setting by name.
-
.[]=(name, value) ⇒ void
private
Sets a scoped setting by name.
-
.active_scope ⇒ String
private
Returns the active scope for character settings.
-
.to_hash ⇒ OpenStruct
private
Converts the character settings to a hash-like structure.
Class Method Details
.[](name) ⇒ OpenStruct
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.
Retrieves a scoped setting by name.
19 20 21 |
# File 'documented/common/settings/charsettings.rb', line 19 def self.[](name) Settings.get_scoped_setting(active_scope, name) end |
.[]=(name, 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.
Sets a scoped setting by name.
28 29 30 |
# File 'documented/common/settings/charsettings.rb', line 28 def self.[]=(name, value) Settings.set_script_settings(active_scope, name, value) end |
.active_scope ⇒ String
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 the active scope for character settings.
This scope is a combination of the current game and character name.
10 11 12 13 |
# File 'documented/common/settings/charsettings.rb', line 10 def self.active_scope # Ensure XMLData.game and XMLData.name are available and up-to-date when scope is needed "#{XMLData.game}:#{XMLData.name}" end |
.to_hash ⇒ OpenStruct
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.
Converts the character settings to a hash-like structure.
This method returns a root proxy for the character settings scope, allowing persistent modifications on the returned object for legacy support.
37 38 39 40 41 42 |
# File 'documented/common/settings/charsettings.rb', line 37 def self.to_hash # NB: This method does not behave like a standard Ruby hash request. # It returns a root proxy for the character settings scope, allowing persistent # modifications on the returned object for legacy support. Settings.wrap_value_if_container(Settings.current_script_settings(active_scope), active_scope, []) end |