class MarkusRESTfulAPI::Assignments

A singleton that allows us to get and update assignment(s)

Public Class Methods

create(attributes) click to toggle source
# File lib/tools/api_wrapper/api_wrapper.rb, line 120
def self.create(attributes)
  url = 'assignments.json'
  response = self.post(url, attributes)

  self.get_by_short_identifier(attributes['short_identifier'])
end
get_all() click to toggle source
# File lib/tools/api_wrapper/api_wrapper.rb, line 116
def self.get_all()
  self.get('assignments.json')
end
get_by_id(id) click to toggle source
# File lib/tools/api_wrapper/api_wrapper.rb, line 108
def self.get_by_id(id)
  self.get("assignments/#{id}.json")
end
get_by_short_identifier(short_identifier) click to toggle source
# File lib/tools/api_wrapper/api_wrapper.rb, line 112
def self.get_by_short_identifier(short_identifier)
  self.get("assignments.json?filter=short_identifier:#{short_identifier}")[0]
end
update(id, attributes) click to toggle source
# File lib/tools/api_wrapper/api_wrapper.rb, line 127
def self.update(id, attributes)
  attributes.delete('id')
  url = "assignments/#{id}.json"
  self.put(url, attributes)

  self.get_by_id(id)
end