Class: TerminalShop::Resources::View

Inherits:
Object
  • Object
show all
Defined in:
lib/terminal_shop/resources/view.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ View

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of View.

Parameters:



28
29
30
# File 'lib/terminal_shop/resources/view.rb', line 28

def initialize(client:)
  @client = client
end

Instance Method Details

#init(request_options: {}) ⇒ TerminalShop::Models::ViewInitResponse

Get initial app data, including user, products, cart, addresses, cards, subscriptions, and orders.

Parameters:

Returns:

See Also:



16
17
18
19
20
21
22
23
# File 'lib/terminal_shop/resources/view.rb', line 16

def init(params = {})
  @client.request(
    method: :get,
    path: "view/init",
    model: TerminalShop::Models::ViewInitResponse,
    options: params[:request_options]
  )
end