Module: Monkeylearn::WorkflowMetadata

Extended by:
Requests
Defined in:
lib/monkeylearn/workflows.rb

Class Method Summary collapse

Methods included from Requests

get_connection, get_exception_class, raise_for_status, request, throttled?

Class Method Details

.build_endpoint(module_id, *args) ⇒ Object



79
80
81
# File 'lib/monkeylearn/workflows.rb', line 79

def build_endpoint(module_id, *args)
  File.join('workflows', module_id, 'metadata', *args.collect { |x| x.to_s }) + '/'
end

.create(module_id, options = {}) ⇒ Object



83
84
85
86
87
88
89
# File 'lib/monkeylearn/workflows.rb', line 83

def create(module_id, options = {})
  data = {
      name: options[:name],
      type: options[:data_type],
  }.delete_if { |k,v| v.nil? }
  request(:post, build_endpoint(module_id), data)
end