Class: JPush::Push::Audience
- Inherits:
-
Object
- Object
- JPush::Push::Audience
- Defined in:
- lib/jpush/push/audience.rb
Instance Method Summary collapse
- #set_abtest(abtest) ⇒ Object
- #set_alias(alis) ⇒ Object
- #set_registration_id(registration_ids) ⇒ Object
- #set_segment(segment) ⇒ Object
- #set_tag(tags) ⇒ Object
- #set_tag_and(tags) ⇒ Object
- #set_tag_not(tags) ⇒ Object
- #to_hash ⇒ Object
Instance Method Details
#set_abtest(abtest) ⇒ Object
35 36 37 38 |
# File 'lib/jpush/push/audience.rb', line 35 def set_abtest(abtest) @abtest = [abtest].flatten self end |
#set_alias(alis) ⇒ Object
20 21 22 23 |
# File 'lib/jpush/push/audience.rb', line 20 def set_alias(alis) @alias = [alis].flatten self end |
#set_registration_id(registration_ids) ⇒ Object
25 26 27 28 |
# File 'lib/jpush/push/audience.rb', line 25 def set_registration_id(registration_ids) @registration_id = [registration_ids].flatten self end |
#set_segment(segment) ⇒ Object
30 31 32 33 |
# File 'lib/jpush/push/audience.rb', line 30 def set_segment(segment) @segment = [segment].flatten self end |
#set_tag(tags) ⇒ Object
5 6 7 8 |
# File 'lib/jpush/push/audience.rb', line 5 def set_tag() @tag = [].flatten self end |
#set_tag_and(tags) ⇒ Object
10 11 12 13 |
# File 'lib/jpush/push/audience.rb', line 10 def set_tag_and() @tag_and = [].flatten self end |
#set_tag_not(tags) ⇒ Object
15 16 17 18 |
# File 'lib/jpush/push/audience.rb', line 15 def set_tag_not() @tag_not = [].flatten self end |
#to_hash ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/jpush/push/audience.rb', line 40 def to_hash @audience = { tag: @tag, tag_and: @tag_and, tag_not: @tag_not, alias: @alias, registration_id: @registration_id, segment: @segment, abtest: @abtest }.select { |_, value| !value.nil? } @audience end |