Class: Pushbullet_CLI::Device
- Inherits:
-
Thor
- Object
- Thor
- Pushbullet_CLI::Device
- Defined in:
- lib/pb/cli/device.rb
Instance Method Summary collapse
Instance Method Details
#list ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/pb/cli/device.rb', line 13 def list url = "https://api.pushbullet.com/v2/devices?active=true" token = Utils::get_token( ) cols = [ 'iden', 'nickname', 'created' ] unless [:fields].nil? unless [:fields].empty? cols = [:fields].split( /\s*,\s*/ ) end end result = Utils::send( url, token, "get" ) Utils::print( { :format => [:format], :cols => cols, :rows => result['devices'], } ) end |