Module: MarketingCloudSDK::Targeting
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#soap_endpoint ⇒ Object
readonly
Returns the value of attribute soap_endpoint.
Instance Method Summary collapse
Methods included from HTTPRequest
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
40 41 42 |
# File 'lib/marketingcloudsdk/targeting.rb', line 40 def access_token @access_token end |
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
41 42 43 |
# File 'lib/marketingcloudsdk/targeting.rb', line 41 def endpoint @endpoint end |
#soap_endpoint ⇒ Object (readonly)
Returns the value of attribute soap_endpoint.
41 42 43 |
# File 'lib/marketingcloudsdk/targeting.rb', line 41 def soap_endpoint @soap_endpoint end |
Instance Method Details
#cache_file ⇒ Object
45 46 47 |
# File 'lib/marketingcloudsdk/targeting.rb', line 45 def cache_file 'soap_cache_file.json' end |
#get_soap_endpoint_from_file ⇒ Object
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/marketingcloudsdk/targeting.rb', line 56 def get_soap_endpoint_from_file data_hash = nil if File.exist? cache_file file = File.read(cache_file) data_hash = JSON.parse(file) end data_hash end |
#set_soap_endpoint_to_file(url) ⇒ Object
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/marketingcloudsdk/targeting.rb', line 67 def set_soap_endpoint_to_file url data_hash = { 'url' => url, 'timestamp' => Time.new.to_f + (10 * 60) } File.open(cache_file, 'w') do |f| f.write(JSON.generate(data_hash)) end end |