Class: BackgroundQueue::ServerLib::PriorityArray
- Inherits:
-
Array
- Object
- Array
- BackgroundQueue::ServerLib::PriorityArray
- Defined in:
- lib/background_queue/server_lib/priority_queue.rb
Overview
this is an array with a priority attribute
Instance Attribute Summary collapse
-
#priority ⇒ Object
Returns the value of attribute priority.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(priority) ⇒ PriorityArray
constructor
A new instance of PriorityArray.
- #inspect ⇒ Object
Constructor Details
#initialize(priority) ⇒ PriorityArray
Returns a new instance of PriorityArray.
117 118 119 120 |
# File 'lib/background_queue/server_lib/priority_queue.rb', line 117 def initialize(priority) @priority = priority super(0) end |
Instance Attribute Details
#priority ⇒ Object
Returns the value of attribute priority.
116 117 118 |
# File 'lib/background_queue/server_lib/priority_queue.rb', line 116 def priority @priority end |
Instance Method Details
#==(other) ⇒ Object
122 123 124 |
# File 'lib/background_queue/server_lib/priority_queue.rb', line 122 def ==(other) other.priority == self.priority end |
#inspect ⇒ Object
126 127 128 |
# File 'lib/background_queue/server_lib/priority_queue.rb', line 126 def inspect "#{self.priority}:#{super}" end |