Sha256: 18244437ad94d35283c197ef3549d12ed7ab69509a27125cb9d7a7b6b22903c0

Contents?: true

Size: 596 Bytes

Versions: 12

Compression:

Stored size: 596 Bytes

Contents

module Centaman
  class Service::CouponCheck < Centaman::Service
    include Centaman::JsonWrapper
    attr_reader :coupon_code

    def after_init(args)
      @coupon_code = args[:coupon_code]
      require_args
    end

    def endpoint
      '/coupon_services/check'
    end

    def object_class
      Centaman::Object::CouponCheck
    end

    def options_hash
      {
        'CouponCode' => coupon_code,
        'ProductArea' => 'TimedTickets'
      }.to_json
    end

    def require_args
      raise "coupon_code is required for #{self.class.name}" if coupon_code.nil?
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
centaman-0.1.11 lib/centaman/service/coupon_check.rb
centaman-0.1.10 lib/centaman/service/coupon_check.rb
centaman-0.1.9 lib/centaman/service/coupon_check.rb
centaman-0.1.8 lib/centaman/service/coupon_check.rb
centaman-0.1.7 lib/centaman/service/coupon_check.rb
centaman-0.1.6 lib/centaman/service/coupon_check.rb
centaman-0.1.5 lib/centaman/service/coupon_check.rb
centaman-0.1.4 lib/centaman/service/coupon_check.rb
centaman-0.1.3 lib/centaman/service/coupon_check.rb
centaman-0.1.2 lib/centaman/service/coupon_check.rb
centaman-0.1.1 lib/centaman/service/coupon_check.rb
centaman-0.1.0 lib/centaman/service/coupon_check.rb