Class: Printful::FilesResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/printful/resources/files.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Printful::Resource

Instance Method Details

#create(**params) ⇒ Object


9
10
11
12
# File 'lib/printful/resources/files.rb', line 9

def create(**params)
  response = post_request("files", body: params)
  File.new(response.body["result"])
end

#retrieve(id:) ⇒ Object


4
5
6
7
# File 'lib/printful/resources/files.rb', line 4

def retrieve(id:)
  response = get_request("files/#{id}")
  File.new(response.body["result"])
end