Module: Lite::Containers::Abstract::ImplicitKey

Included in:
Lite::Containers::AvlTree::Interfaces::KeyExtractionStrategy::Implicit, Heap, SortedArray, TopN::Abstract
Defined in:
lib/lite/containers/abstract/implicit_key.rb

Instance Method Summary collapse

Instance Method Details

#<<(element) ⇒ Object

Inserts element the way push does. Returns self



16
17
18
19
# File 'lib/lite/containers/abstract/implicit_key.rb', line 16

def <<(element)
  push(element)
  self
end

#push(_element) ⇒ Object

Inserts element at its corresponding place. In case element is already there applies merge strategy

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/lite/containers/abstract/implicit_key.rb', line 11

def push(_element)
  raise NotImplementedError, "#{self.class.name}##{__method__} unimplemented"
end