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.
52 53 54 55 |
# File 'lib/bosh/director/api/extensions/scoping.rb', line 52 def initialize(name, scope) @name = name.to_s @scope = scope end |
Instance Method Details
#scope(params, default_scope) ⇒ Object
57 58 59 60 |
# File 'lib/bosh/director/api/extensions/scoping.rb', line 57 def scope(params, default_scope) scope_name = params.fetch(@name, :default).to_sym @scope.fetch(scope_name, default_scope) end |