Class: Mailersend::Activity
- Inherits:
-
Object
- Object
- Mailersend::Activity
- Defined in:
- lib/mailersend/activity/activity.rb
Overview
Activity endpoint from MailerSend API
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#date_from ⇒ Object
Returns the value of attribute date_from.
-
#date_to ⇒ Object
Returns the value of attribute date_to.
-
#domain_id ⇒ Object
Returns the value of attribute domain_id.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#page ⇒ Object
Returns the value of attribute page.
Instance Method Summary collapse
- #get(domain_id:, page: nil, limit: nil, date_from: nil, date_to: nil) ⇒ Object
-
#initialize(client = Mailersend::Client.new) ⇒ Activity
constructor
A new instance of Activity.
Constructor Details
#initialize(client = Mailersend::Client.new) ⇒ Activity
Returns a new instance of Activity.
13 14 15 16 17 18 19 20 |
# File 'lib/mailersend/activity/activity.rb', line 13 def initialize(client = Mailersend::Client.new) @client = client @domain_id = domain_id @page = page @limit = limit @date_from = date_from @date_to = date_to end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/mailersend/activity/activity.rb', line 6 def client @client end |
#date_from ⇒ Object
Returns the value of attribute date_from.
6 7 8 |
# File 'lib/mailersend/activity/activity.rb', line 6 def date_from @date_from end |
#date_to ⇒ Object
Returns the value of attribute date_to.
6 7 8 |
# File 'lib/mailersend/activity/activity.rb', line 6 def date_to @date_to end |
#domain_id ⇒ Object
Returns the value of attribute domain_id.
6 7 8 |
# File 'lib/mailersend/activity/activity.rb', line 6 def domain_id @domain_id end |
#limit ⇒ Object
Returns the value of attribute limit.
6 7 8 |
# File 'lib/mailersend/activity/activity.rb', line 6 def limit @limit end |
#page ⇒ Object
Returns the value of attribute page.
6 7 8 |
# File 'lib/mailersend/activity/activity.rb', line 6 def page @page end |
Instance Method Details
#get(domain_id:, page: nil, limit: nil, date_from: nil, date_to: nil) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mailersend/activity/activity.rb', line 22 def get(domain_id:, page: nil, limit: nil, date_from: nil, date_to: nil) hash = { page: page, limit: limit, date_from: date_from, date_to: date_to } client.http.get(URI::HTTPS.build(host: MAILERSEND_API_BASE_HOST, path: "/v1/activity/#{domain_id}", query: URI.encode_www_form(hash.compact))) end |