Class: FoundationApi
- Inherits:
-
Object
- Object
- FoundationApi
- Defined in:
- lib/meshx-plugin-sdk.rb
Instance Method Summary collapse
- #display_response(response) ⇒ Object
- #file_cache_read(uri, destination) ⇒ Object
- #file_cache_write(filename) ⇒ Object
- #get_messages ⇒ Object
-
#initialize ⇒ FoundationApi
constructor
A new instance of FoundationApi.
- #pase_response(response) ⇒ Object
- #send_complete_events ⇒ Object
- #send_file_event(path, filename, originalpath, origin) ⇒ Object
- #send_folder_event(path, folder, originalpath, origin) ⇒ Object
- #send_message(data) ⇒ Object
Constructor Details
#initialize ⇒ FoundationApi
Returns a new instance of FoundationApi.
336 337 |
# File 'lib/meshx-plugin-sdk.rb', line 336 def initialize() end |
Instance Method Details
#display_response(response) ⇒ Object
346 347 348 349 350 |
# File 'lib/meshx-plugin-sdk.rb', line 346 def display_response(response) puts("payload: #{response.payload}") puts("error: #{response.error}") puts("exit_code: #{response.exit_code}") end |
#file_cache_read(uri, destination) ⇒ Object
380 381 382 383 384 385 |
# File 'lib/meshx-plugin-sdk.rb', line 380 def file_cache_read(uri, destination) d, e = GoApi.file_cache_read(uri, destination) parsed = pase_response(d) display_response(parsed) return FileReadResult.new(parsed) end |
#file_cache_write(filename) ⇒ Object
387 388 389 390 391 392 |
# File 'lib/meshx-plugin-sdk.rb', line 387 def file_cache_write(filename) d, e = GoApi.file_cache_write(filename) parsed = pase_response(d) display_response(parsed) return FileWriteResult.new(parsed) end |
#get_messages ⇒ Object
352 353 354 355 356 357 |
# File 'lib/meshx-plugin-sdk.rb', line 352 def () d, e = GoApi.() parsed = pase_response(d) display_response(parsed) return GetMessageResult.new(parsed) end |
#pase_response(response) ⇒ Object
339 340 341 342 343 344 |
# File 'lib/meshx-plugin-sdk.rb', line 339 def pase_response(response) data = JSON.parse(response) rtn = Response.new(data["payload"], data["error"], data["exit_code"]) return rtn end |
#send_complete_events ⇒ Object
394 395 396 397 398 399 |
# File 'lib/meshx-plugin-sdk.rb', line 394 def send_complete_events() d, e = GoApi.send_complete_events() parsed = pase_response(d) display_response(parsed) return SendCompleteResult.new(parsed) end |
#send_file_event(path, filename, originalpath, origin) ⇒ Object
366 367 368 369 370 371 |
# File 'lib/meshx-plugin-sdk.rb', line 366 def send_file_event(path, filename, originalpath, origin) d, e = GoApi.send_file_event(path, filename, originalpath, origin) parsed = pase_response(d) display_response(parsed) return SendMessageResult.new(parsed) end |
#send_folder_event(path, folder, originalpath, origin) ⇒ Object
373 374 375 376 377 378 |
# File 'lib/meshx-plugin-sdk.rb', line 373 def send_folder_event(path, folder, originalpath, origin) d, e = GoApi.send_folder_event(path, folder, originalpath, origin) parsed = pase_response(d) display_response(parsed) return SendFolderResult.new(parsed) end |
#send_message(data) ⇒ Object
359 360 361 362 363 364 |
# File 'lib/meshx-plugin-sdk.rb', line 359 def (data) d, e = GoApi.(data) parsed = pase_response(d) display_response(parsed) return SendMessageResult.new(parsed) end |