Class: Input

Inherits:
Object
  • Object
show all
Defined in:
lib/Input.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInput

Returns a new instance of Input


3
4
5
# File 'lib/Input.rb', line 3

def initialize

end

Instance Attribute Details

#user_commandObject

Returns the value of attribute user_command


2
3
4
# File 'lib/Input.rb', line 2

def user_command
  @user_command
end

Instance Method Details

#get_commandObject


11
12
13
14
15
# File 'lib/Input.rb', line 11

def get_command
  input = gets.chomp
  @user_command, *params = input.split /\s/
  return @user_command
end

#user_input(user_command) ⇒ Object


7
8
9
# File 'lib/Input.rb', line 7

def user_input (user_command)
  @user_command = user_command
end