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.
123 124 125 126 127 |
# File 'lib/background_queue/server_lib/priority_queue.rb', line 123 def initialize(priority) @priority = priority raise "Invalid priority" if @priority.nil? super(0) end |
Instance Attribute Details
#priority ⇒ Object
Returns the value of attribute priority.
122 123 124 |
# File 'lib/background_queue/server_lib/priority_queue.rb', line 122 def priority @priority end |
Instance Method Details
#==(other) ⇒ Object
129 130 131 |
# File 'lib/background_queue/server_lib/priority_queue.rb', line 129 def ==(other) other.priority == self.priority end |
#inspect ⇒ Object
133 134 135 |
# File 'lib/background_queue/server_lib/priority_queue.rb', line 133 def inspect "#{self.priority}:#{super}" end |