Sha256: 16e6074c11652bf8512f48f324d0881dfa40c92ae35ca00e6956a52883abf0a3
Contents?: true
Size: 865 Bytes
Versions: 1
Compression:
Stored size: 865 Bytes
Contents
# frozen_string_literal: true module Balboa module Interactor class CapybaraInteractor CommandNotFound = Class.new(RuntimeError) LoginCommandNotFound = Class.new(CommandNotFound) def initialize @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 attr_accessor :signed_in alias_method :signed_in?, :signed_in def login @commands['login'].execute @signed_in = true rescue CommandNotFound raise LoginCommandNotFound end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
balboa-0.1.2 | lib/balboa/interactor/capybara_interactor.rb |