Class: ScanBeacon::GenericAdvertiser

Inherits:
Object
  • Object
show all
Defined in:
lib/scan_beacon/generic_advertiser.rb

Direct Known Subclasses

GenericIndividualAdvertiser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ 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

#adObject

Returns the value of attribute ad.



3
4
5
# File 'lib/scan_beacon/generic_advertiser.rb', line 3

def ad
  @ad
end

#advertisingObject (readonly)

Returns the value of attribute advertising.



4
5
6
# File 'lib/scan_beacon/generic_advertiser.rb', line 4

def advertising
  @advertising
end

#beaconObject

Returns the value of attribute beacon.



3
4
5
# File 'lib/scan_beacon/generic_advertiser.rb', line 3

def beacon
  @beacon
end

#parserObject

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

#inspectObject

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/scan_beacon/generic_advertiser.rb', line 24

def inspect
  raise NotImplementedError
end

#start(with_rotation = false) ⇒ Object

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/scan_beacon/generic_advertiser.rb', line 16

def start(with_rotation = false)
  raise NotImplementedError
end

#stopObject

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/scan_beacon/generic_advertiser.rb', line 20

def stop
  raise NotImplementedError
end