class Shifty::RosterizedGang

Attributes

gang[R]

Public Class Methods

new(gang) click to toggle source
# File lib/shifty/roster.rb, line 13
def initialize(gang)
  @gang = gang
end

Public Instance Methods

"<<"(worker)
Alias for: push
pop() click to toggle source
# File lib/shifty/roster.rb, line 29
def pop
  gang.workers.pop.tap do |popped|
    popped.supply = nil
  end
end
push(worker) click to toggle source
# File lib/shifty/roster.rb, line 21
def push(worker)
  if worker
    worker.supply = workers.last
    workers << worker
  end
end
Also aliased as: "<<"
shift() click to toggle source
# File lib/shifty/roster.rb, line 35
def shift
  workers.shift.tap do
    workers.first.supply = nil
  end
end
unshift(worker) click to toggle source
# File lib/shifty/roster.rb, line 41
def unshift(worker)
  workers.first.supply = worker
  workers.unshift worker
end
workers() click to toggle source
# File lib/shifty/roster.rb, line 17
def workers
  gang.workers
end