Class: Adva::Static::Export::Queue

Inherits:
Array
  • Object
show all
Defined in:
lib/adva/static/export/queue.rb

Instance Method Summary collapse

Instance Method Details

#logObject



21
22
23
# File 'lib/adva/static/export/queue.rb', line 21

def log
  @log ||= []
end

#push(*elements) ⇒ Object



5
6
7
8
9
10
# File 'lib/adva/static/export/queue.rb', line 5

def push(*elements)
  elements = Array(elements).flatten.uniq
  elements.reject! { |element| seen?(element) }
  seen(elements)
  super
end

#seen(elements) ⇒ Object



16
17
18
19
# File 'lib/adva/static/export/queue.rb', line 16

def seen(elements)
  @log = log.concat(elements)
  log.uniq!
end

#seen?(element) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/adva/static/export/queue.rb', line 12

def seen?(element)
  log.include?(element)
end