class Dotloop::Template

Attributes

client[RW]

Public Class Methods

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

Public Instance Methods

all(profile_id:) click to toggle source
# File lib/dotloop/template.rb, line 11
def all(profile_id:)
  @client.get("/profile/#{profile_id.to_i}/loop-template")[:data].map do |template_attrs|
    template = Dotloop::Models::Template.new(template_attrs)
    template.client = client
    template.profile_id = profile_id.to_i
    template
  end
end
find(profile_id:, loop_template_id:) click to toggle source
# File lib/dotloop/template.rb, line 20
def find(profile_id:, loop_template_id:)
  template_data = @client.get("/profile/#{profile_id.to_i}/loop-template/#{loop_template_id.to_i}")[:data]
  template = Dotloop::Models::Template.new(template_data)
  template.client = client
  template.profile_id = profile_id.to_i
  template
end