class Cogibara::Confirmer

Public Instance Methods

actions() click to toggle source
# File lib/cogibara/confirmer.rb, line 4
def actions
  @actions ||= []
end
add_action(message,success=nil,failure=nil) click to toggle source
# File lib/cogibara/confirmer.rb, line 8
def add_action(message,success=nil,failure=nil)
  actions << [message,success,failure]
end
confirm_action() click to toggle source
# File lib/cogibara/confirmer.rb, line 12
def confirm_action
  act = actions.shift
  if act[1]
    act[1].call
  end
end
deny_action() click to toggle source
# File lib/cogibara/confirmer.rb, line 19
def deny_action
  act = actions.shift
  if act[2]
    act[2].call
  end
end
waiting?() click to toggle source
# File lib/cogibara/confirmer.rb, line 26
def waiting?
  !actions.empty?
end