Class: SteamCodec::ACF::UserConfig
- Inherits:
-
Object
- Object
- SteamCodec::ACF::UserConfig
- Defined in:
- lib/steam_codec/ACF.rb
Instance Attribute Summary collapse
-
#AppInstallDir ⇒ Object
Returns the value of attribute AppInstallDir.
-
#BetaKey ⇒ Object
Returns the value of attribute BetaKey.
-
#GameID ⇒ Object
Returns the value of attribute GameID.
-
#Installed ⇒ Object
Returns the value of attribute Installed.
-
#Language ⇒ Object
Returns the value of attribute Language.
-
#Name ⇒ Object
Returns the value of attribute Name.
Instance Method Summary collapse
-
#initialize(userConfig = nil) ⇒ UserConfig
constructor
A new instance of UserConfig.
- #load(userConfig) ⇒ Object
Constructor Details
#initialize(userConfig = nil) ⇒ UserConfig
76 77 78 |
# File 'lib/steam_codec/ACF.rb', line 76 def initialize(userConfig = nil) load(userConfig || KeyValues.new) end |
Instance Attribute Details
#AppInstallDir ⇒ Object
Returns the value of attribute AppInstallDir.
73 74 75 |
# File 'lib/steam_codec/ACF.rb', line 73 def AppInstallDir @AppInstallDir end |
#BetaKey ⇒ Object
Returns the value of attribute BetaKey.
75 76 77 |
# File 'lib/steam_codec/ACF.rb', line 75 def BetaKey @BetaKey end |
#GameID ⇒ Object
Returns the value of attribute GameID.
71 72 73 |
# File 'lib/steam_codec/ACF.rb', line 71 def GameID @GameID end |
#Installed ⇒ Object
Returns the value of attribute Installed.
72 73 74 |
# File 'lib/steam_codec/ACF.rb', line 72 def Installed @Installed end |
#Language ⇒ Object
Returns the value of attribute Language.
74 75 76 |
# File 'lib/steam_codec/ACF.rb', line 74 def Language @Language end |
#Name ⇒ Object
Returns the value of attribute Name.
70 71 72 |
# File 'lib/steam_codec/ACF.rb', line 70 def Name @Name end |
Instance Method Details
#load(userConfig) ⇒ Object
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/steam_codec/ACF.rb', line 80 def load(userConfig) raise ArgumentError, "UserConfig must be instance of KeyValues" unless userConfig.is_a?(KeyValues) @UserConfig = userConfig @Name = @UserConfig.name if @UserConfig.key?(:name) @GameID = @UserConfig.gameid.to_i if @UserConfig.key?(:gameid) @Installed = !@UserConfig.installdir.to_i.zero? if @UserConfig.key?(:installdir) @AppInstallDir = @UserConfig.appinstalldir if @UserConfig.key?(:appinstalldir) @Language = @UserConfig.language if @UserConfig.key?(:language) @BetaKey = @UserConfig.BetaKey if @UserConfig.key?(:BetaKey) end |