Sha256: a595a26d012d014042994d6250cff6ccfbad3159c9a272a8fe4263b88647edfa

Contents?: true

Size: 876 Bytes

Versions: 11

Compression:

Stored size: 876 Bytes

Contents

require 'urbanairship'

module Urbanairship
    module  AbTests
        class Variant
        include Urbanairship::Common
        include Urbanairship::Loggable
        attr_accessor :description,
                      :id,
                      :name,
                      :push,
                      :schedule,
                      :weight

        def initialize(client: required('client'))
            @client = client
        end

        def payload
            fail ArgumentError, 'a push must be added to create a variant' if @push.nil?

            {
             'description': description,
             'id': id,
             'name': name,
             'push': push,
             'schedule': schedule,
             'weight': weight   
            }.delete_if {|key, value| value.nil?} #this removes the nil key value pairs
        end

        end 
    end 
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
urbanairship-9.2.0 lib/urbanairship/ab_tests/variant.rb
urbanairship-9.1.1 lib/urbanairship/ab_tests/variant.rb
urbanairship-9.1.0 lib/urbanairship/ab_tests/variant.rb
urbanairship-9.0.0 lib/urbanairship/ab_tests/variant.rb
urbanairship-8.0.1 lib/urbanairship/ab_tests/variant.rb
urbanairship-8.0.0 lib/urbanairship/ab_tests/variant.rb
urbanairship-7.0.0 lib/urbanairship/ab_tests/variant.rb
urbanairship-6.0.0 lib/urbanairship/ab_tests/variant.rb
urbanairship-5.9.0 lib/urbanairship/ab_tests/variant.rb
urbanairship-5.8.0 lib/urbanairship/ab_tests/variant.rb
urbanairship-5.7.0 lib/urbanairship/ab_tests/variant.rb