Sha256: 1bcf83f1e625ddb6c9b1ff4473a5718b8dfcca8bd0691c823cdfe29f5865f3be
Contents?: true
Size: 680 Bytes
Versions: 11
Compression:
Stored size: 680 Bytes
Contents
module FiveMobilePush class Tag attr_accessor :device_uid def initialize(client, device_uid) @client = client self.device_uid = device_uid end def create(*tags) @client.post(end_point(:add), :id_type => FiveMobilePush::DEFAULT_ID_TYPE, :id_value => self.device_uid, :tags => normalize_tags(tags)) end def delete(*tags) @client.post(end_point(:delete), :id_type => FiveMobilePush::DEFAULT_ID_TYPE, :id_value => self.device_uid, :tags => normalize_tags(tags)) end private def normalize_tags(tags) tags.flatten.join(",") end def end_point(action) "device/tags/#{action}" end end end
Version data entries
11 entries across 11 versions & 1 rubygems