Class: Rubotnik::User
- Inherits:
-
Object
- Object
- Rubotnik::User
- Defined in:
- lib/rubotnik/user.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#session ⇒ Object
Returns the value of attribute session.
Instance Method Summary collapse
- #assign_command(command) ⇒ Object
- #current_command ⇒ Object
-
#initialize(id) ⇒ User
constructor
A new instance of User.
- #reset_command ⇒ Object
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
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/rubotnik/user.rb', line 2 def id @id end |
#session ⇒ Object
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_command ⇒ Object
11 12 13 |
# File 'lib/rubotnik/user.rb', line 11 def current_command @commands.last end |
#reset_command ⇒ Object
19 20 21 |
# File 'lib/rubotnik/user.rb', line 19 def reset_command @commands = [] end |