Class: ProximityBeacon::Beacon

Inherits:
GoogleResource show all
Defined in:
lib/proximity_beacon/beacon.rb

Instance Method Summary collapse

Methods inherited from GoogleResource

#as_json, camelcase_attr_accessor, #initialize, #to_json, #update

Constructor Details

This class inherits a constructor from ProximityBeacon::GoogleResource

Instance Method Details

#advertised_id=(value) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/proximity_beacon/beacon.rb', line 12

def advertised_id=(value)
  if value.is_a? Hash
    @advertised_id = AdvertisedId.new(value)
  else
    @advertised_id = value
  end
end

#idObject



20
21
22
# File 'lib/proximity_beacon/beacon.rb', line 20

def id
  name.split("/")[1]
end

#inspectObject



32
33
34
# File 'lib/proximity_beacon/beacon.rb', line 32

def inspect
  "#<Beacon name=\"#{name}\" description=\"#{description}\" advertised_id=#{advertised_id.inspect}>"
end

#instanceObject



28
29
30
# File 'lib/proximity_beacon/beacon.rb', line 28

def instance
  advertised_id.ids[1]
end

#namespaceObject



24
25
26
# File 'lib/proximity_beacon/beacon.rb', line 24

def namespace
  advertised_id.ids[0]
end