Module: PactBroker::Api::Resources::Authorization
- Included in:
- BaseResource
- Defined in:
- lib/pact_broker/api/resources/authorization.rb
Instance Method Summary collapse
- #action ⇒ Object
- #create_methods ⇒ Object
- #delete_methods ⇒ Object
- #read_methods ⇒ Object
- #update_methods ⇒ Object
Instance Method Details
#action ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/pact_broker/api/resources/authorization.rb', line 5 def action if read_methods.include?(request.method) :read elsif update_methods.include?(request.method) :update elsif create_methods.include?(request.method) :create elsif delete_methods.include?(request.method) :delete else raise "Cannot map #{request.method} to an action" end end |
#create_methods ⇒ Object
27 28 29 |
# File 'lib/pact_broker/api/resources/authorization.rb', line 27 def create_methods %w{POST PUT} end |
#delete_methods ⇒ Object
31 32 33 |
# File 'lib/pact_broker/api/resources/authorization.rb', line 31 def delete_methods %w{DELETE} end |
#read_methods ⇒ Object
19 20 21 |
# File 'lib/pact_broker/api/resources/authorization.rb', line 19 def read_methods %w{GET HEAD OPTIONS} end |
#update_methods ⇒ Object
23 24 25 |
# File 'lib/pact_broker/api/resources/authorization.rb', line 23 def update_methods %w{PUT PATCH} end |