Class: Packet::GlobalIDLocator

Inherits:
Object
  • Object
show all
Defined in:
lib/packet/global_id.rb

Constant Summary collapse

CLASS_MAP =
{
  'Instance' => :device
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ GlobalIDLocator

Returns a new instance of GlobalIDLocator.



9
10
11
# File 'lib/packet/global_id.rb', line 9

def initialize(client)
  @client = client || Packet::Client.instance
end

Instance Method Details

#locate(gid) ⇒ Object



13
14
15
# File 'lib/packet/global_id.rb', line 13

def locate(gid)
  @client.send method_for_model_name(gid.model_name), gid.model_id
end