Class: QueueSystem::Customer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arrival_time) ⇒ Customer

Returns a new instance of Customer.



5
6
7
8
9
10
11
# File 'lib/queue_system/customer.rb', line 5

def initialize(arrival_time)
  @id = SecureRandom.uuid[0..7]
  @arrival_time = arrival_time
  @service_time = generate_service_time
  @wait_time = 0
  @departure_time = nil
end

Instance Attribute Details

#arrival_timeObject (readonly)

Returns the value of attribute arrival_time.



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

def arrival_time
  @arrival_time
end

#departure_timeObject (readonly)

Returns the value of attribute departure_time.



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

def departure_time
  @departure_time
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#service_timeObject (readonly)

Returns the value of attribute service_time.



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

def service_time
  @service_time
end

#wait_timeObject (readonly)

Returns the value of attribute wait_time.



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

def wait_time
  @wait_time
end