Module: Mountapi::Handler::Behaviour::ClassMethods
- Defined in:
- lib/mountapi/handler/behaviour.rb
Overview
extend class
Instance Attribute Summary collapse
-
#roles ⇒ Object
readonly
Returns the value of attribute roles.
Instance Method Summary collapse
Instance Attribute Details
#roles ⇒ Object (readonly)
Returns the value of attribute roles.
95 96 97 |
# File 'lib/mountapi/handler/behaviour.rb', line 95 def roles @roles end |
Instance Method Details
#allowed_roles(*roles) ⇒ Object
91 92 93 |
# File 'lib/mountapi/handler/behaviour.rb', line 91 def allowed_roles(*roles) @roles = roles end |
#call(params, options = {}) ⇒ Object
82 83 84 85 |
# File 'lib/mountapi/handler/behaviour.rb', line 82 def call(params, = {}) instance = new(params, ) instance.role_allowed? ? instance.call : instance.forbidden("Not Allowed") end |