Class: FiveMobilePush::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/five_mobile_push/tag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, device_uid) ⇒ Tag

Returns a new instance of Tag.



6
7
8
9
# File 'lib/five_mobile_push/tag.rb', line 6

def initialize(client, device_uid)
  @client = client
  self.device_uid = device_uid
end

Instance Attribute Details

#device_uidObject

Returns the value of attribute device_uid.



4
5
6
# File 'lib/five_mobile_push/tag.rb', line 4

def device_uid
  @device_uid
end

Instance Method Details

#create(*tags) ⇒ Object



11
12
13
# File 'lib/five_mobile_push/tag.rb', line 11

def create(*tags)
  @client.post(end_point(:add), :id_type => FiveMobilePush::DEFAULT_ID_TYPE, :id_value => self.device_uid, :tags => normalize_tags(tags))
end

#delete(*tags) ⇒ Object



15
16
17
# File 'lib/five_mobile_push/tag.rb', line 15

def delete(*tags)
  @client.post(end_point(:delete), :id_type => FiveMobilePush::DEFAULT_ID_TYPE, :id_value => self.device_uid, :tags => normalize_tags(tags))
end