Class: Lignite::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/lignite/connection.rb,
lib/lignite/connection/usb.rb,
lib/lignite/connection/bluetooth.rb

Direct Known Subclasses

Bluetooth, Usb

Defined Under Namespace

Classes: Bluetooth, Usb

Class Method Summary collapse

Class Method Details

.createConnection

Returns Try a Usb connection first, then a Bluetooth one.

Returns:



4
5
6
7
8
9
10
# File 'lib/lignite/connection.rb', line 4

def self.create
  @c ||= begin
           Usb.new
         rescue NoUsbDevice
           Bluetooth.new
         end
end