Class: Balboa::Interactor::InteractorBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/balboa/interactor/interactor_builder.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ InteractorBuilder

Returns a new instance of InteractorBuilder.



15
16
17
18
# File 'lib/balboa/interactor/interactor_builder.rb', line 15

def initialize(options)
  @options = options
  @interactor = Balboa::Interactor::CapybaraInteractor.new(options)
end

Class Method Details

.create(*args) ⇒ Object



11
12
13
# File 'lib/balboa/interactor/interactor_builder.rb', line 11

def self.create(*args)
  new(*args).create
end

Instance Method Details

#createObject



20
21
22
23
24
25
26
27
28
# File 'lib/balboa/interactor/interactor_builder.rb', line 20

def create
  last_punch = Balboa::Interactor::Command::FetchLastPunchCommand.new

  @interactor.tap do |itr|
    itr.add_command(:punch, fill_punch)
    itr.add_command(:last, last_punch)
    itr.add_command(:login, )
  end
end