Class: LemonSqueezy::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/lemon_squeezy/models/store.rb

Class Method Summary collapse

Methods inherited from Object

#initialize, #to_ostruct

Constructor Details

This class inherits a constructor from LemonSqueezy::Object

Class Method Details

.listObject



6
7
8
9
# File 'lib/lemon_squeezy/models/store.rb', line 6

def list
  response = Client.get_request("stores")
  Collection.from_response(response, type: Store)
end

.retrieve(id:) ⇒ Object



11
12
13
14
# File 'lib/lemon_squeezy/models/store.rb', line 11

def retrieve(id:)
  response = Client.get_request("stores/#{id}")
  Store.new(response.body["data"]) if response.success?
end