Class: Factorix::MODState
- Inherits:
-
Data
- Object
- Data
- Factorix::MODState
- Defined in:
- lib/factorix/mod_state.rb,
lib/factorix/mod_state.rb
Overview
Represents the state of a MOD in a MOD list
This class encapsulates the enabled/disabled state and version information for a MOD as it appears in the mod-list.json file.
Instance Attribute Summary collapse
-
#enabled ⇒ Boolean
readonly
Whether the MOD is enabled.
-
#version ⇒ Factorix::MODVersion?
readonly
The version of the MOD, or nil if the version is not specified.
Instance Method Summary collapse
-
#enabled? ⇒ Boolean
Check if the MOD is enabled.
-
#initialize(enabled:, version: nil) ⇒ void
constructor
Initialize a new MODState.
Constructor Details
#initialize(enabled:, version: nil) ⇒ void
Initialize a new MODState
21 |
# File 'lib/factorix/mod_state.rb', line 21 def initialize(enabled:, version: nil) = super |
Instance Attribute Details
#enabled ⇒ Boolean (readonly)
Returns whether the MOD is enabled.
23 24 25 |
# File 'lib/factorix/mod_state.rb', line 23 def enabled @enabled end |
#version ⇒ Factorix::MODVersion? (readonly)
Returns the version of the MOD, or nil if the version is not specified.
26 27 28 |
# File 'lib/factorix/mod_state.rb', line 26 def version @version end |
Instance Method Details
#enabled? ⇒ Boolean
Check if the MOD is enabled
32 |
# File 'lib/factorix/mod_state.rb', line 32 def enabled? = enabled |