Module: Pushbullet::API
- Included in:
- Client
- Defined in:
- lib/pushbullet/api.rb
Instance Method Summary collapse
- #devices ⇒ Object
- #push_address(device_id, title, address) ⇒ Object
- #push_file(device_id, file_path) ⇒ Object
- #push_link(device_id, title, url) ⇒ Object
- #push_list(device_id, title, items) ⇒ Object
- #push_note(device_id, title, body) ⇒ Object
Instance Method Details
#devices ⇒ Object
3 4 5 |
# File 'lib/pushbullet/api.rb', line 3 def devices get('/api/devices') end |
#push_address(device_id, title, address) ⇒ Object
15 16 17 |
# File 'lib/pushbullet/api.rb', line 15 def push_address(device_id, title, address) push :address, device_id, title: title, address: address end |
#push_file(device_id, file_path) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/pushbullet/api.rb', line 23 def push_file(device_id, file_path) mime_type = MIME::Types.type_for(file_path).first.to_s io = Faraday::UploadIO.new(file_path, mime_type) push :file, device_id, file: io end |
#push_link(device_id, title, url) ⇒ Object
11 12 13 |
# File 'lib/pushbullet/api.rb', line 11 def push_link(device_id, title, url) push :link, device_id, title: title, url: url end |
#push_list(device_id, title, items) ⇒ Object
19 20 21 |
# File 'lib/pushbullet/api.rb', line 19 def push_list(device_id, title, items) push :list, device_id, title: title, items: items end |
#push_note(device_id, title, body) ⇒ Object
7 8 9 |
# File 'lib/pushbullet/api.rb', line 7 def push_note(device_id, title, body) push :note, device_id, title: title, body: body end |