Class: PhidgetRfid::Commands
- Inherits:
-
Object
- Object
- PhidgetRfid::Commands
- Extended by:
- CLI::Task
- Defined in:
- lib/phidget_rfid/commands.rb
Instance Method Summary collapse
- #clear(params) ⇒ Object
- #device(params) ⇒ Object
-
#initialize(rfid) ⇒ Commands
constructor
A new instance of Commands.
- #log(params) ⇒ Object
- #protocol(params) ⇒ Object
- #read(params) ⇒ Object
- #write(params) ⇒ Object
Constructor Details
#initialize(rfid) ⇒ Commands
14 15 16 |
# File 'lib/phidget_rfid/commands.rb', line 14 def initialize (rfid) @rfid = rfid end |
Instance Method Details
#clear(params) ⇒ Object
49 50 51 |
# File 'lib/phidget_rfid/commands.rb', line 49 def clear(params) system "clear" or system "cls" end |
#device(params) ⇒ Object
56 57 58 |
# File 'lib/phidget_rfid/commands.rb', line 56 def device(params) puts @rfid.device end |
#log(params) ⇒ Object
63 64 65 |
# File 'lib/phidget_rfid/commands.rb', line 63 def log(params) puts @rfid.log end |
#protocol(params) ⇒ Object
40 41 42 |
# File 'lib/phidget_rfid/commands.rb', line 40 def protocol(params) puts @rfid.protocol end |
#read(params) ⇒ Object
22 23 24 |
# File 'lib/phidget_rfid/commands.rb', line 22 def read(params) puts @rfid.read end |
#write(params) ⇒ Object
31 32 33 |
# File 'lib/phidget_rfid/commands.rb', line 31 def write(params) puts @rfid.write params[0] unless params.empty? end |