lib/mailersend/analytics/analytics.rb in mailersend-ruby-0.2.0 vs lib/mailersend/analytics/analytics.rb in mailersend-ruby-0.2.1

- old
+ new

@@ -12,72 +12,72 @@ :group_by, :tags def initialize(client = Mailersend::Client.new) @client = client - @date_from = "" - @date_to = "" + @date_from = '' + @date_to = '' @events = [] - @domain_id = "" - @recipient_id = "" - @group_by = "" + @domain_id = '' + @recipient_id = '' + @group_by = '' @tags = [] end def date(date_from:, date_to:, events:, domain_id: nil, recipient_id: nil, group_by: nil, tags: nil) hash = { - "date_from" => date_from, - "date_to" => date_to, - "event[]" => events, - "domain_id" => domain_id, - "recipient_id" => recipient_id, - "group_by" => group_by, - "tags[]" => tags + 'date_from' => date_from, + 'date_to' => date_to, + 'event[]' => events, + 'domain_id' => domain_id, + 'recipient_id' => recipient_id, + 'group_by' => group_by, + 'tags[]' => tags } - response = client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/analytics/date", + response = client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/analytics/date', query: URI.encode_www_form(hash.compact))) puts response end def country(date_from:, date_to:, domain_id: nil, recipient_id: nil, tags: nil) hash = { domain_id: domain_id, recipient_id: recipient_id, date_from: date_from, date_to: date_to, - "tags[]": tags + 'tags[]': tags } - response = client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/analytics/country", + response = client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/analytics/country', query: URI.encode_www_form(hash.compact))) puts response end def ua_name(date_from:, date_to:, domain_id: nil, recipient_id: nil, tags: nil) hash = { domain_id: domain_id, recipient_id: recipient_id, date_from: date_from, date_to: date_to, - "tags[]": tags + 'tags[]': tags } - response = client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/analytics/ua-name", + response = client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/analytics/ua-name', query: URI.encode_www_form(hash.compact))) puts response end def ua_type(date_from:, date_to:, domain_id: nil, recipient_id: nil, tags: nil) hash = { domain_id: domain_id, recipient_id: recipient_id, date_from: date_from, date_to: date_to, - "tags[]": tags + 'tags[]': tags } - response = client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: "/v1/analytics/ua-type", + response = client.http.get(URI::HTTPS.build(host: API_BASE_HOST, path: '/v1/analytics/ua-type', query: URI.encode_www_form(hash.compact))) puts response end end end