Method: Printful::Collection.from_response

Defined in:
lib/printful/collection.rb

.from_response(body:, type:) ⇒ Object



5
6
7
8
9
10
# File 'lib/printful/collection.rb', line 5

def self.from_response(body:, type:)
  new(
    data: body.map { |attrs| type.new(attrs) },
    count: body.count
  )
end