Class: ScanBeacon::GenericIndividualAdvertiser
Instance Attribute Summary
#ad, #advertising, #beacon, #parser
Instance Method Summary
collapse
#inspect, #start, #stop
Constructor Details
Returns a new instance of GenericIndividualAdvertiser.
3
4
5
6
|
# File 'lib/scan_beacon/generic_individual_advertiser.rb', line 3
def initialize(opts={})
@parser = nil
super(opts)
end
|
Instance Method Details
#ad=(value) ⇒ Object
22
23
24
25
|
# File 'lib/scan_beacon/generic_individual_advertiser.rb', line 22
def ad=(value)
@ad = value
self.start if advertising
end
|
#beacon=(value) ⇒ Object
8
9
10
11
|
# File 'lib/scan_beacon/generic_individual_advertiser.rb', line 8
def beacon=(value)
@beacon = value
update_ad
end
|
#parser=(value) ⇒ Object
13
14
15
16
|
# File 'lib/scan_beacon/generic_individual_advertiser.rb', line 13
def parser=(value)
@parser = value
update_ad
end
|
#update_ad ⇒ Object
18
19
20
|
# File 'lib/scan_beacon/generic_individual_advertiser.rb', line 18
def update_ad
self.ad = @parser.generate_ad(@beacon) if @parser && @beacon
end
|