Class: Bosh::Director::Api::Extensions::Scoping::ParamsScope
- Defined in:
- lib/bosh/director/api/extensions/scoping.rb
Instance Method Summary collapse
-
#initialize(name, scope) ⇒ ParamsScope
constructor
A new instance of ParamsScope.
- #scope(params, default_scope) ⇒ Object
Constructor Details
#initialize(name, scope) ⇒ ParamsScope
Returns a new instance of ParamsScope.
55 56 57 58 |
# File 'lib/bosh/director/api/extensions/scoping.rb', line 55 def initialize(name, scope) @name = name.to_s @scope = scope end |
Instance Method Details
#scope(params, default_scope) ⇒ Object
60 61 62 63 |
# File 'lib/bosh/director/api/extensions/scoping.rb', line 60 def scope(params, default_scope) scope_name = params.fetch(@name, :default).to_sym @scope.fetch(scope_name, default_scope) end |