Sha256: 2b14b6ea6415b3260b84cf8b68658d688a9b43d06c5b1f07f497d542e0a698b3

Contents?: true

Size: 879 Bytes

Versions: 2

Compression:

Stored size: 879 Bytes

Contents

module Centaman
  class Object::CouponCheck < Centaman::Object
    attr_reader :effects

    def after_init(args = {})
      define_effects(args)
    end

    def define_effects(args)
      @effects = args['Effects'].map do |effect_hash|
        Centaman::Object::Effect.new(effect_hash)
      end
    end

    # rubocop:disable Metrics/MethodLength
    def attributes
      [
        Centaman::Attribute.new(
          centaman_key: 'CouponCode',
          app_key: :coupon_code,
          type: :integer
        ),
        
        Centaman::Attribute.new(
          centaman_key: 'LimitedUse',
          app_key: :limited_use,
          type: :boolean
        ),
        Centaman::Attribute.new(
          centaman_key: 'UsesRemaining',
          app_key: :uses_remaining,
          type: :integer
        )
      ]
    end
    # rubocop:enable Metrics/MethodLength
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
centaman-0.1.13 lib/centaman/object/coupon_check.rb
centaman-0.1.12 lib/centaman/object/coupon_check.rb