Class: SRSGame::Settings
Overview
:doc:
Class Attribute Summary (collapse)
-
+ (Object) env
readonly
Returns the value of attribute env.
Class Method Summary (collapse)
- + (Object) [](key)
-
+ (Object) apply!
Apply settings.
-
+ (Object) default_settings
SRS GAME's default settings.
-
+ (Object) seed(seed)
Add what we are seeding to @env.
Class Attribute Details
+ (Object) env (readonly)
Returns the value of attribute env
272 273 274 |
# File 'lib/srs_game.rb', line 272 def env @env end |
Class Method Details
+ (Object) [](key)
282 283 284 |
# File 'lib/srs_game.rb', line 282 def [](key) @env[key.to_s.upcase] end |
+ (Object) apply!
Apply settings. TODO: make these things configurable.
288 289 290 291 292 293 294 295 |
# File 'lib/srs_game.rb', line 288 def self.apply! Readline.completion_append_character = " " puts "Howdy, partner!" if S[:says_howdy_partner].to_s.to_bool if S[:matches_short_methods].to_bool completion_proc = proc { |s| command.matching_methods(s).map(&:command_pp) } Readline.completion_proc = completion_proc end # if end |
+ (Object) default_settings
SRS GAME's default settings
298 299 300 301 302 303 304 |
# File 'lib/srs_game.rb', line 298 def self.default_settings { "GREETING_SPEED" => 20, "SAYS_HOWDY_PARTNER" => false, "MATCHES_SHORT_METHODS" => true } end |
+ (Object) seed(seed)
Add what we are seeding to @env
275 276 277 278 279 |
# File 'lib/srs_game.rb', line 275 def seed(seed) @env ||= default_settings @env << seed self end |