Class: BrazeRuby::REST::EmailStatus

Inherits:
Base
  • Object
show all
Defined in:
lib/braze_ruby/rest/email_status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, braze_url, email: nil, status: nil) ⇒ EmailStatus

Returns a new instance of EmailStatus.



6
7
8
9
10
11
# File 'lib/braze_ruby/rest/email_status.rb', line 6

def initialize(api_key, braze_url, email: nil, status: nil)
  @api_key = api_key
  @email = email
  @status = status
  super braze_url
end

Instance Attribute Details

#api_key ⇒ Object (readonly)

Returns the value of attribute api_key.



4
5
6
# File 'lib/braze_ruby/rest/email_status.rb', line 4

def api_key
  @api_key
end

#email ⇒ Object (readonly)

Returns the value of attribute email.



4
5
6
# File 'lib/braze_ruby/rest/email_status.rb', line 4

def email
  @email
end

#status ⇒ Object (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/braze_ruby/rest/email_status.rb', line 4

def status
  @status
end

Instance Method Details

#perform ⇒ Object



13
14
15
16
17
18
19
# File 'lib/braze_ruby/rest/email_status.rb', line 13

def perform
  http.post '/email/status', {
    'api_key': api_key,
    'email': email,
    'subscription_state': status
  }
end