Class: Wes::Data::API::Submission

Inherits:
Object
  • Object
show all
Extended by:
Base
Defined in:
lib/wes/data/api/submission.rb

Class Method Summary collapse

Methods included from Base

add_state, client, configuration, map_objects, routes

Class Method Details

.create(options) ⇒ Object



11
12
13
14
# File 'lib/wes/data/api/submission.rb', line 11

def create(options)
  attributes = client.post(routes.submission, options).first
  attributes.nil? ? nil : model_klass.new(attributes)
end

.find(_key, value) ⇒ Object



16
17
18
19
20
# File 'lib/wes/data/api/submission.rb', line 16

def find(_key, value)
  route = [routes.submission, value].join("/")
  attributes = client.get(route).first
  attributes.nil? ? nil : model_klass.new(attributes)
end