Class: Thimble::QueueItem
- Inherits:
-
Object
- Object
- Thimble::QueueItem
- Defined in:
- lib/queue_item.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
Instance Method Summary collapse
-
#initialize(item, name = 'Item') ⇒ QueueItem
constructor
A new instance of QueueItem.
- #to_s ⇒ Object
Constructor Details
#initialize(item, name = 'Item') ⇒ QueueItem
Returns a new instance of QueueItem.
8 9 10 11 12 |
# File 'lib/queue_item.rb', line 8 def initialize(item, name = 'Item') @id = Digest::SHA256.digest(rand(10**100).to_s + Time.now.to_i.to_s) @item = item @name = name end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/queue_item.rb', line 6 def id @id end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
6 7 8 |
# File 'lib/queue_item.rb', line 6 def item @item end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/queue_item.rb', line 14 def to_s "#{@name}: #{@item} ID: #{@id}" end |