Module: Monkeylearn::Workflows
- Extended by:
- Requests
- Defined in:
- lib/monkeylearn/workflows.rb
Class Method Summary collapse
- .build_endpoint(*args) ⇒ Object
- .create(name, options = {}) ⇒ Object
- .data ⇒ Object
- .delete(module_id) ⇒ Object
- .detail(module_id) ⇒ Object
- .metadata ⇒ Object
- .steps ⇒ Object
Methods included from Requests
get_connection, get_exception_class, raise_for_status, request, throttled?
Class Method Details
.build_endpoint(*args) ⇒ Object
27 28 29 |
# File 'lib/monkeylearn/workflows.rb', line 27 def build_endpoint(*args) File.join('workflows', *args) + '/' end |
.create(name, options = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/monkeylearn/workflows.rb', line 31 def create(name, = {}) data = { name: name, description: [:description], db_name: [:db_name], webhook_url: [:webhook_url], steps: [:steps], metadata: [:metadata], sources: [:sources], actions: [:actions], }.delete_if { |k,v| v.nil? } request(:post, build_endpoint, data) end |
.data ⇒ Object
19 20 21 |
# File 'lib/monkeylearn/workflows.rb', line 19 def data return WorkflowData end |
.delete(module_id) ⇒ Object
49 50 51 |
# File 'lib/monkeylearn/workflows.rb', line 49 def delete(module_id) request(:delete, build_endpoint(module_id)) end |
.detail(module_id) ⇒ Object
45 46 47 |
# File 'lib/monkeylearn/workflows.rb', line 45 def detail(module_id) request(:get, build_endpoint(module_id)) end |
.metadata ⇒ Object
23 24 25 |
# File 'lib/monkeylearn/workflows.rb', line 23 def return WorkflowMetadata end |
.steps ⇒ Object
15 16 17 |
# File 'lib/monkeylearn/workflows.rb', line 15 def steps return WorkflowSteps end |