Sha256: fd0842e6232e80be04568ae264648f820d813fa4f61c75cb39eb142726e14316

Contents?: true

Size: 844 Bytes

Versions: 9

Compression:

Stored size: 844 Bytes

Contents

module Octobat
  class Coupon < APIResource
    extend Octobat::APIOperations::List
    include Octobat::APIOperations::Create
    include Octobat::APIOperations::Update

    def activate(params = {}, opts = {})
      response, api_key = Octobat.request(:patch, activate_url, @api_key, params, opts)
      refresh_from(response, api_key)
    end

    def unactivate(params = {}, opts = {})
      response, api_key = Octobat.request(:patch, unactivate_url, @api_key, params, opts)
      refresh_from(response, api_key)
    end

    def delete(params = {}, opts = {})
      response, api_key = Octobat.request(:delete, url, @api_key, params, opts)
      refresh_from(response, api_key)
    end
    

    private

      def activate_url
        url + '/activate'
      end

      def unactivate_url
        url + '/unactivate'
      end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
octobat-2.0.27 lib/octobat/coupon.rb
octobat-2.0.26 lib/octobat/coupon.rb
octobat-2.0.25 lib/octobat/coupon.rb
octobat-2.0.24 lib/octobat/coupon.rb
octobat-2.0.23 lib/octobat/coupon.rb
octobat-2.0.22 lib/octobat/coupon.rb
octobat-2.0.21 lib/octobat/coupon.rb
octobat-2.0.20 lib/octobat/coupon.rb
octobat-2.0.19 lib/octobat/coupon.rb