smartsend-ruby 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56f48dacc875c60fec85b99ce459499d94b59ac1c7f70dd3fc9cd2d2187063ba
4
- data.tar.gz: 435baa32e16f05e2d70edb60398b402be38f386f61ac859c7de61ab5e522fce7
3
+ metadata.gz: 6559955d47563838d40e6ed2a3a197c5af19783a5f3b9e8c224941d72a6537f9
4
+ data.tar.gz: 99914570cb17b3a22c2fe281e25b17463cecdcc4653600dbb25b5521a20f7999
5
5
  SHA512:
6
- metadata.gz: 3c4776a022ae3079fae3fd01d6a638f6c3749f7a1cd25d62104707b204a2b9fb49e9172d874025ebae324c15d0ca981f44f7e9b37e62673683f61153f5d1e390
7
- data.tar.gz: 9b20ea69f03947937fb0deb5434090ba6687893e056559915429cc8ea560e94dbd204f83745c2caf4ecb71f567acda1fd6ef0db4a3142abb426997c9a1080ebf
6
+ metadata.gz: 06e31ba54f3a013a8ea876721a13a89df59d6c624c029f1c9c264f00afac69763a61047acf9da8e1ab93de84ac6c197af3003b3f9778f23e5eb8d49c3a97bebb
7
+ data.tar.gz: 9f93847459da401435b5be8d645f2ee891bfcc1a57bd6371fc5bb9e0204cd6c817ede13a36d68bf1b7d3b27e2f66e7beecc8fdf5607631a2536c7f6a6bfd648d
@@ -1,10 +1,10 @@
1
1
  class Smartsend::Account
2
- attr_accessor :api_token
3
- attr_accessor :referer
2
+ attr_accessor :api_token, :referer, :user_agents
4
3
 
5
- def initialize(api_token:, referer: nil)
4
+ def initialize(api_token:, referer: nil, user_agents: nil)
6
5
  @api_token = api_token
7
6
  @referer = referer
7
+ @user_agents = user_agents
8
8
  end
9
9
 
10
10
  def valid?
@@ -78,12 +78,16 @@ class Smartsend::Client
78
78
  Logger.new($stdout)
79
79
  end
80
80
 
81
+ def user_agent_string
82
+ (["Ruby/#{Smartsend::VERSION}"] + @account.user_agents.to_a).join(' ')
83
+ end
84
+
81
85
  def http
82
86
  raise Smartsend::MissingConfigError, 'Missing api_token' if @account.api_token.nil?
83
87
 
84
88
  HTTP.headers({
85
89
  accept: 'application/json',
86
- user_agent: "Shopify/#{Smartsend::VERSION}",
90
+ user_agent: user_agent_string,
87
91
  referer: @account.referer
88
92
  })
89
93
  end
@@ -1,3 +1,3 @@
1
1
  module Smartsend
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartsend-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aske Hansen