Class: Rubotnik::User

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ User

Returns a new instance of User.



5
6
7
8
9
# File 'lib/rubotnik/user.rb', line 5

def initialize(id)
  @id = id
  @commands = []
  @session = {}
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#sessionObject

Returns the value of attribute session.



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

def session
  @session
end

Instance Method Details

#assign_command(command) ⇒ Object



15
16
17
# File 'lib/rubotnik/user.rb', line 15

def assign_command(command)
  @commands << command
end

#current_commandObject



11
12
13
# File 'lib/rubotnik/user.rb', line 11

def current_command
  @commands.last
end

#reset_commandObject



19
20
21
# File 'lib/rubotnik/user.rb', line 19

def reset_command
  @commands = []
end