Class: TerminalShop::Resources::Email

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Email

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 Email.

Parameters:



31
32
33
# File 'lib/terminal_shop/resources/email.rb', line 31

def initialize(client:)
  @client = client
end

Instance Method Details

#create(email:, request_options: {}) ⇒ TerminalShop::Models::EmailCreateResponse

Subscribe to email updates from Terminal.

Parameters:

  • email (String)

    Email address to subscribe to Terminal updates with.

  • request_options (TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



17
18
19
20
21
22
23
24
25
26
# File 'lib/terminal_shop/resources/email.rb', line 17

def create(params)
  parsed, options = TerminalShop::EmailCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "email",
    body: parsed,
    model: TerminalShop::Models::EmailCreateResponse,
    options: options
  )
end