Class: Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Client

Returns a new instance of Client.



4
5
6
7
8
# File 'lib/client.rb', line 4

def initialize(name)
  @name = name
  @tasks = []
  @top_task = top_task
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#tasksObject

Returns the value of attribute tasks.



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

def tasks
  @tasks
end

#top_taskObject

Returns the value of attribute top_task.



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

def top_task
  @top_task
end

Instance Method Details

#add_task(task_description) ⇒ Object



10
11
12
# File 'lib/client.rb', line 10

def add_task(task_description)
  tasks << task_description
end