Class: Pushybullet::Types::PushTarget

Inherits:
Object
  • Object
show all
Defined in:
lib/pushybullet/types/push_target.rb

Constant Summary collapse

ID_TYPES =
{
  channel: 'channel_tag',
  client: 'client_iden',
  device: 'device_iden',
  email: 'email'
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(type, id) ⇒ PushTarget

Returns a new instance of PushTarget.



13
14
15
16
# File 'lib/pushybullet/types/push_target.rb', line 13

def initialize(type, id)
  @type = type
  @id = id
end

Instance Method Details

#keyObject



18
19
20
# File 'lib/pushybullet/types/push_target.rb', line 18

def key
  ID_TYPES[@type]
end

#valueObject



22
23
24
# File 'lib/pushybullet/types/push_target.rb', line 22

def value
  @id
end