Module: Lite::Containers::Abstract::Queue

Included in:
Deque, Heap
Defined in:
lib/lite/containers/abstract/queue.rb

Instance Method Summary collapse

Instance Method Details

#drain!Object

Returns all elements in descending order by priority

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/lite/containers/abstract/queue.rb', line 18

def drain!
  raise NotImplementedError, "#{self.class.name}##{__method__} unimplemented"
end

#frontObject

Returns highest priority element or nil if empty

Raises:

  • (NotImplementedError)


8
9
10
# File 'lib/lite/containers/abstract/queue.rb', line 8

def front
  raise NotImplementedError, "#{self.class.name}##{__method__} unimplemented"
end

#pop_frontObject

Removes and returns highest priority element or nil if empty

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/lite/containers/abstract/queue.rb', line 13

def pop_front
  raise NotImplementedError, "#{self.class.name}##{__method__} unimplemented"
end