Sha256: 7e2d14d650448f5a3a1fb8dc9f6edd5f719aa7eb2031e7eca5bfa96037e90fef

Contents?: true

Size: 855 Bytes

Versions: 3

Compression:

Stored size: 855 Bytes

Contents

module Session

  def get_session(key, options={})
    options.merge!({:basic_auth => @auth})
    response = self.class.get(base_api_endpoint("Web/Session/#{key}"), options)
    JSON.parse(response.body)
  end

  def get_promotion(key, code, options={})
    parameters =
      {
          'PromoCode': code
      }
    options.merge!({:basic_auth => @auth})
    options.merge!(:body => parameters)
    response = self.class.post(base_api_endpoint("Web/Session/#{key}/PromoCode"), options)
    JSON.parse(response.body)
  end

  def get_promotion_code(key, code, options={})
    parameters =
      {
          'PromoCodeString': code
      }
    options.merge!({:basic_auth => @auth})
    options.merge!(:body => parameters)
    response = self.class.post(base_api_endpoint("Web/Session/#{key}/PromoCode"), options)
    JSON.parse(response.body)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tessitura_rest-0.1.4 lib/tessitura_rest/web/session.rb
tessitura_rest-0.1.3 lib/tessitura_rest/web/session.rb
tessitura_rest-0.1.2 lib/tessitura_rest/web/session.rb