Class: ScanBeacon::GenericAdvertiser
- Inherits:
-
Object
- Object
- ScanBeacon::GenericAdvertiser
- Defined in:
- lib/scan_beacon/generic_advertiser.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#ad ⇒ Object
Returns the value of attribute ad.
-
#advertising ⇒ Object
readonly
Returns the value of attribute advertising.
-
#beacon ⇒ Object
Returns the value of attribute beacon.
-
#parser ⇒ Object
Returns the value of attribute parser.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ GenericAdvertiser
constructor
A new instance of GenericAdvertiser.
- #inspect ⇒ Object
- #start(with_rotation = false) ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ GenericAdvertiser
Returns a new instance of GenericAdvertiser.
6 7 8 9 10 11 12 13 14 |
# File 'lib/scan_beacon/generic_advertiser.rb', line 6 def initialize(opts = {}) self.beacon = opts[:beacon] self.parser = opts[:parser] self.ad = opts[:ad] if opts[:ad] if beacon self.parser ||= BeaconParser.default_parsers.find {|parser| parser.beacon_type == beacon.beacon_types.first} end @advertising = false end |
Instance Attribute Details
#ad ⇒ Object
Returns the value of attribute ad.
3 4 5 |
# File 'lib/scan_beacon/generic_advertiser.rb', line 3 def ad @ad end |
#advertising ⇒ Object (readonly)
Returns the value of attribute advertising.
4 5 6 |
# File 'lib/scan_beacon/generic_advertiser.rb', line 4 def advertising @advertising end |
#beacon ⇒ Object
Returns the value of attribute beacon.
3 4 5 |
# File 'lib/scan_beacon/generic_advertiser.rb', line 3 def beacon @beacon end |
#parser ⇒ Object
Returns the value of attribute parser.
3 4 5 |
# File 'lib/scan_beacon/generic_advertiser.rb', line 3 def parser @parser end |
Instance Method Details
#inspect ⇒ Object
24 25 26 |
# File 'lib/scan_beacon/generic_advertiser.rb', line 24 def inspect raise NotImplementedError end |
#start(with_rotation = false) ⇒ Object
16 17 18 |
# File 'lib/scan_beacon/generic_advertiser.rb', line 16 def start(with_rotation = false) raise NotImplementedError end |
#stop ⇒ Object
20 21 22 |
# File 'lib/scan_beacon/generic_advertiser.rb', line 20 def stop raise NotImplementedError end |