Class: Workarea::Emarsys::Gateway
- Inherits:
-
Object
- Object
- Workarea::Emarsys::Gateway
- Defined in:
- app/lib/workarea/emarsys/gateway.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#secret_key ⇒ Object
readonly
Returns the value of attribute secret_key.
-
#user_name ⇒ Object
readonly
Returns the value of attribute user_name.
Instance Method Summary collapse
- #create_contact(attrs) ⇒ Object
-
#initialize(secret_key, user_name, options = {}) ⇒ Gateway
constructor
A new instance of Gateway.
Constructor Details
#initialize(secret_key, user_name, options = {}) ⇒ Gateway
Returns a new instance of Gateway.
6 7 8 9 10 |
# File 'app/lib/workarea/emarsys/gateway.rb', line 6 def initialize(secret_key, user_name, = {}) @secret_key = secret_key @user_name = user_name @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'app/lib/workarea/emarsys/gateway.rb', line 4 def @options end |
#secret_key ⇒ Object (readonly)
Returns the value of attribute secret_key.
4 5 6 |
# File 'app/lib/workarea/emarsys/gateway.rb', line 4 def secret_key @secret_key end |
#user_name ⇒ Object (readonly)
Returns the value of attribute user_name.
4 5 6 |
# File 'app/lib/workarea/emarsys/gateway.rb', line 4 def user_name @user_name end |
Instance Method Details
#create_contact(attrs) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/lib/workarea/emarsys/gateway.rb', line 12 def create_contact(attrs) base_uri = "/api/v2/contact/" params = { create_if_not_exists: 1 } query_values = "?" + params.to_query path = base_uri + query_values response = connection.put do |req| req.url path req.params = params req.body = attrs.to_json end Response.new(response) end |