class Dotloop::Tasklist

Attributes

client[RW]

Public Class Methods

new(client:) click to toggle source
# File lib/dotloop/tasklist.rb, line 7
def initialize(client:)
  @client = client
end

Public Instance Methods

all(profile_id:, loop_id:) click to toggle source
# File lib/dotloop/tasklist.rb, line 11
def all(profile_id:, loop_id:)
  @client.get("/profile/#{profile_id.to_i}/loop/#{loop_id.to_i}/tasklist")[:data].map do |tasklist_attrs|
    tasklist = Dotloop::Models::Tasklist.new(tasklist_attrs)
    tasklist.client = client
    tasklist.profile_id = profile_id.to_i
    tasklist.loop_id = loop_id.to_i
    tasklist
  end
end
find(profile_id:, loop_id:, task_list_id:) click to toggle source
# File lib/dotloop/tasklist.rb, line 21
def find(profile_id:, loop_id:, task_list_id:)
  tasklist_data = @client.get("/profile/#{profile_id.to_i}/loop/#{loop_id.to_i}/tasklist/#{task_list_id.to_i}")[:data]
  tasklist = Dotloop::Models::Tasklist.new(tasklist_data)
  tasklist.client = client
  tasklist.profile_id = profile_id.to_i
  tasklist.loop_id = loop_id.to_i
  tasklist
end