Module: Cyclid::API::Plugins::ApiExtension::Methods

Included in:
GithubMethods
Defined in:
app/cyclid/plugins/api.rb

Overview

Default method callbacks.

The use of a 405 response here is slightly wrong as technically each method is implemented. We’re supposed to send back an Allow: header to indicate which methods we do support, but that’d be all four of them…

Instance Method Summary collapse

Instance Method Details

#delete(_headers, _config) ⇒ Object

DELETE callback



101
102
103
104
# File 'app/cyclid/plugins/api.rb', line 101

def delete(_headers, _config)
  authorize('delete')
  return_failure(405, 'not implemented')
end

#get(_headers, _config) ⇒ Object

GET callback



83
84
85
86
# File 'app/cyclid/plugins/api.rb', line 83

def get(_headers, _config)
  authorize('get')
  return_failure(405, 'not implemented')
end

#post(_headers, _config) ⇒ Object

POST callback



89
90
91
92
# File 'app/cyclid/plugins/api.rb', line 89

def post(_headers, _config)
  authorize('post')
  return_failure(405, 'not implemented')
end

#put(_headers, _config) ⇒ Object

PUT callback



95
96
97
98
# File 'app/cyclid/plugins/api.rb', line 95

def put(_headers, _config)
  authorize('put')
  return_failure(405, 'not implemented')
end