Class: Squake::Model::Product

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/squake/model/product.rb

Class Method Summary collapse

Class Method Details

.from_api_response(response_body) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/squake/model/product.rb', line 14

def self.from_api_response(response_body)
  Squake::Model::Product.new(
    id: response_body.fetch(:id),
    title: response_body.fetch(:title),
    certifications: response_body.fetch(:certifications, []),
  )
end