class WoerkClient::Commands::StartShift

Public Instance Methods

call() click to toggle source
# File lib/woerk_client/commands/start_shift.rb, line 8
def call
  start_shift
rescue RestClient::ExceptionWithResponse => e
  errors.add(:start, e.message)
end

Private Instance Methods

shift() click to toggle source
# File lib/woerk_client/commands/start_shift.rb, line 22
def shift
  WoerkClient::Models::Shift.new(started_at: Time.now)
end
start_shift() click to toggle source
# File lib/woerk_client/commands/start_shift.rb, line 16
def start_shift
  if shift.save
    "Shift started"
  end
end