Class: Mastermind::Main
- Inherits:
-
Object
- Object
- Mastermind::Main
- Includes:
- Helper
- Defined in:
- lib/mastermind/extensions/extensions.rb,
lib/mastermind/main.rb
Overview
module Helper
def get_input()
# puts "Whatever it is"
end
def ()
end
end
Instance Attribute Summary collapse
-
#game ⇒ Object
readonly
Returns the value of attribute game.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize ⇒ Main
constructor
A new instance of Main.
- #old_play ⇒ Object
- #play ⇒ Object
- #start ⇒ Object
Methods included from Helper
Constructor Details
#initialize ⇒ Main
6 7 8 |
# File 'lib/mastermind/main.rb', line 6 def initialize @response = Message.new end |
Instance Attribute Details
#game ⇒ Object (readonly)
Returns the value of attribute game.
4 5 6 |
# File 'lib/mastermind/main.rb', line 4 def game @game end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/mastermind/main.rb', line 4 def response @response end |
Instance Method Details
#old_play ⇒ Object
19 20 21 |
# File 'lib/mastermind/extensions/extensions.rb', line 19 def play @game.play end |
#play ⇒ Object
30 31 32 |
# File 'lib/mastermind/main.rb', line 30 def play @game.play end |
#start ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mastermind/main.rb', line 10 def start action = get_input(@response.start.) if supported_actions.keys.include? action @game ||= Game.new(@response) method(supported_actions[action]).call else @response.unsupported_game_action. end start if supported_actions[action] =~ /instructions|background/ || @response.status == :unsupported_action end |