Class: QueueSystem::Customer
- Inherits:
-
Object
- Object
- QueueSystem::Customer
- Defined in:
- lib/queue_system/customer.rb
Instance Attribute Summary collapse
-
#arrival_time ⇒ Object
readonly
Returns the value of attribute arrival_time.
-
#departure_time ⇒ Object
readonly
Returns the value of attribute departure_time.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#service_time ⇒ Object
readonly
Returns the value of attribute service_time.
-
#wait_time ⇒ Object
readonly
Returns the value of attribute wait_time.
Instance Method Summary collapse
-
#initialize(arrival_time) ⇒ Customer
constructor
A new instance of Customer.
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_time ⇒ Object (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_time ⇒ Object (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 |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/queue_system/customer.rb', line 3 def id @id end |
#service_time ⇒ Object (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_time ⇒ Object (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 |