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



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

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

#idObject



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

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

#inspectObject



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

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

#instanceObject



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

def instance
  advertised_id.ids[1]
end

#namespaceObject



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

def namespace
  advertised_id.ids[0]
end