Class: DotloopApi::EndPoints::Document

Inherits:
Base
  • Object
show all
Defined in:
lib/dotloop_api/end_points/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#all, #create, #delete, #find, #save, #single_path

Methods included from ModelBuilder

#build_details, #build_documents, #build_model

Constructor Details

#initialize(client:, profile_id: nil, loop_id: nil, folder_id: nil) ⇒ Document

Returns a new instance of Document.



8
9
10
11
12
13
# File 'lib/dotloop_api/end_points/document.rb', line 8

def initialize(client:, profile_id: nil, loop_id: nil, folder_id: nil)
  @profile_id = profile_id
  @loop_id = loop_id
  @folder_id = folder_id
  super(client:, path:, type: DotloopApi::Models::Profile::Loop::Folder::Document)
end

Instance Attribute Details

#folder_idObject

Returns the value of attribute folder_id.



4
5
6
# File 'lib/dotloop_api/end_points/document.rb', line 4

def folder_id
  @folder_id
end

#loop_idObject

Returns the value of attribute loop_id.



4
5
6
# File 'lib/dotloop_api/end_points/document.rb', line 4

def loop_id
  @loop_id
end

#profile_idObject

Returns the value of attribute profile_id.



4
5
6
# File 'lib/dotloop_api/end_points/document.rb', line 4

def profile_id
  @profile_id
end

Instance Method Details

#download(id:) ⇒ Object



19
20
21
# File 'lib/dotloop_api/end_points/document.rb', line 19

def download(id:)
  @client.download(single_path(id))
end

#pathObject



15
16
17
# File 'lib/dotloop_api/end_points/document.rb', line 15

def path
  "/profile/#{@profile_id}/loop/#{@loop_id}/folder/#{@folder_id}/document"
end