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

Returns a new instance of GenericAdvertiser.



6
7
8
9
10
11
12
13
# File 'lib/scan_beacon/generic_advertiser.rb', line 6

def initialize(opts = {})
  self.beacon = opts[:beacon]
  self.parser = opts[:parser]
  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)


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

def inspect
  raise NotImplementedError
end

#start(with_rotation = false) ⇒ Object

Raises:

  • (NotImplementedError)


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

def start(with_rotation = false)
  raise NotImplementedError
end

#stopObject

Raises:

  • (NotImplementedError)


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

def stop
  raise NotImplementedError
end