Module: Pendaxes::PendingManager

Included in:
Notificator, Reporter
Defined in:
lib/pendaxes/pending_manager.rb

Instance Method Summary collapse

Instance Method Details

#add(pending = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/pendaxes/pending_manager.rb', line 5

def add(pending={})
  case pending
  when Array
    @pendings.push *pending.map{|x| Hashr.new(x) }
  when Hash
    @pendings << Hashr.new(pending)
  end
end

#all_pendingsObject



22
23
24
# File 'lib/pendaxes/pending_manager.rb', line 22

def all_pendings
  @pendings
end

#pendingsObject



14
15
16
17
18
19
20
# File 'lib/pendaxes/pending_manager.rb', line 14

def pendings
  if @config.include_allowed
    all_pendings
  else
    @pendings.reject(&:allowed)
  end
end

#resetObject



26
27
28
# File 'lib/pendaxes/pending_manager.rb', line 26

def reset
  @pendings = []
end