Class: Mailersend::SMSActivity

Inherits:
Object
  • Object
show all
Defined in:
lib/mailersend/sms_activity/sms_activity.rb

Overview

SMS Activity endpoint from MailerSend API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client = Mailersend::Client.new) ⇒ SMSActivity

Returns a new instance of SMSActivity.



10
11
12
13
14
# File 'lib/mailersend/sms_activity/sms_activity.rb', line 10

def initialize(client = Mailersend::Client.new)
  @client = client
  @page = page
  @limit = limit
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



6
7
8
# File 'lib/mailersend/sms_activity/sms_activity.rb', line 6

def client
  @client
end

#limitObject

Returns the value of attribute limit.



6
7
8
# File 'lib/mailersend/sms_activity/sms_activity.rb', line 6

def limit
  @limit
end

#pageObject

Returns the value of attribute page.



6
7
8
# File 'lib/mailersend/sms_activity/sms_activity.rb', line 6

def page
  @page
end

Instance Method Details

#list(page: nil, limit: nil) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/mailersend/sms_activity/sms_activity.rb', line 16

def list(page: nil, limit: nil)
  hash = {
    'page' => page,
    'limit' => limit
  }

  client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: '/v1/sms-activity',
                                   query: URI.encode_www_form(hash)))
end