module HydroponicBean::Commands

Public Instance Methods

for_job(id) { |job| ... } click to toggle source

Find a job by id and yield it

Outputs Protocol::NOT_FOUND if the block returns false or the job is not found

# File lib/hydroponic_bean/commands.rb, line 17
def for_job(id)
  job = HydroponicBean.find_job(id)
  if !job || !yield(job)
    output(Protocol::NOT_FOUND)
    return false
  end
end