class MiracleGrow::Planting

Public Class Methods

plantings_for_bed(id) click to toggle source
# File lib/miracle_grow/planting.rb, line 7
def plantings_for_bed(id)
  response = Faraday.get("#{ENV["HOST"]}/api/v1/plantings/for_bed/#{id}")
  plantings = JSON.parse(response.body)
end
taken(bed_id) click to toggle source
# File lib/miracle_grow/planting.rb, line 12
def taken(bed_id)
  plantings_for_bed(bed_id).map do |planting|
    [planting["x_coord"].to_s, planting["y_coord"].to_s, planting["slug"].to_s, planting["harvested"]]
  end
end