Class: Urbanairship::AbTests::Variant
- Inherits:
-
Object
- Object
- Urbanairship::AbTests::Variant
- Defined in:
- lib/urbanairship/ab_tests/variant.rb
Constant Summary
Constants included from Common
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#push ⇒ Object
Returns the value of attribute push.
-
#schedule ⇒ Object
Returns the value of attribute schedule.
-
#weight ⇒ Object
Returns the value of attribute weight.
Instance Method Summary collapse
-
#initialize(client: required('client')) ⇒ Variant
constructor
A new instance of Variant.
- #payload ⇒ Object
Methods included from Loggable
create_logger, logger, #logger
Methods included from Common
#apid_path, #channel_path, #compact_helper, #create_and_send_path, #custom_events_path, #device_token_path, #experiments_path, #lists_path, #named_users_path, #open_channel_path, #pipelines_path, #push_path, #reports_path, #required, #schedules_path, #segments_path, #tag_lists_path, #try_helper
Constructor Details
#initialize(client: required('client')) ⇒ Variant
Returns a new instance of Variant.
15 16 17 |
# File 'lib/urbanairship/ab_tests/variant.rb', line 15 def initialize(client: required('client')) @client = client end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
8 9 10 |
# File 'lib/urbanairship/ab_tests/variant.rb', line 8 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/urbanairship/ab_tests/variant.rb', line 8 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/urbanairship/ab_tests/variant.rb', line 8 def name @name end |
#push ⇒ Object
Returns the value of attribute push.
8 9 10 |
# File 'lib/urbanairship/ab_tests/variant.rb', line 8 def push @push end |
#schedule ⇒ Object
Returns the value of attribute schedule.
8 9 10 |
# File 'lib/urbanairship/ab_tests/variant.rb', line 8 def schedule @schedule end |
#weight ⇒ Object
Returns the value of attribute weight.
8 9 10 |
# File 'lib/urbanairship/ab_tests/variant.rb', line 8 def weight @weight end |
Instance Method Details
#payload ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/urbanairship/ab_tests/variant.rb', line 19 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 |