lib/balboa/interactor/capybara_interactor.rb in balboa-0.1.2 vs lib/balboa/interactor/capybara_interactor.rb in balboa-0.1.3
- old
+ new
@@ -3,29 +3,31 @@
module Balboa
module Interactor
class CapybaraInteractor
CommandNotFound = Class.new(RuntimeError)
- LoginCommandNotFound = Class.new(CommandNotFound)
- def initialize
+ LoginCommandNotFound = Class.new(RuntimeError)
+
+ attr_reader :options
+
+ def initialize(options={})
+ @options = options
@commands = Hash.new { fail CommandNotFound }
@signed_in = false
end
def add_command(key, command)
@commands[key.to_s] = command
end
def last
login unless signed_in?
-
@commands['last'].execute
end
def punch(date)
login unless signed_in?
-
@commands['punch'].execute(date)
end
private