Class: Aws::Templates::Utils::Contextualized::Filter::Scoped
- Inherits:
-
Aws::Templates::Utils::Contextualized::Filter
- Object
- Aws::Templates::Utils::Contextualized::Filter
- Aws::Templates::Utils::Contextualized::Filter::Scoped
- Defined in:
- lib/aws/templates/utils/contextualized/filter/scoped.rb
Overview
Statically scoped filter
Scoped filter wraps whatever Proc obejct passed to it into specified scope for execution. So whatever the scope the filter is called in, it will always be evaluated in the same scope specified at creation.
The filter is used by the internal mechanics of the framework.
Instance Attribute Summary collapse
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#scoped_filter ⇒ Object
readonly
Returns the value of attribute scoped_filter.
Instance Method Summary collapse
- #filter(options, memo, _) ⇒ Object
-
#initialize(fltr, scp) ⇒ Scoped
constructor
A new instance of Scoped.
Methods inherited from Aws::Templates::Utils::Contextualized::Filter
Constructor Details
#initialize(fltr, scp) ⇒ Scoped
Returns a new instance of Scoped.
22 23 24 25 |
# File 'lib/aws/templates/utils/contextualized/filter/scoped.rb', line 22 def initialize(fltr, scp) @scoped_filter = _check_filter(fltr) @scope = scp end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
20 21 22 |
# File 'lib/aws/templates/utils/contextualized/filter/scoped.rb', line 20 def scope @scope end |
#scoped_filter ⇒ Object (readonly)
Returns the value of attribute scoped_filter.
19 20 21 |
# File 'lib/aws/templates/utils/contextualized/filter/scoped.rb', line 19 def scoped_filter @scoped_filter end |
Instance Method Details
#filter(options, memo, _) ⇒ Object
27 28 29 |
# File 'lib/aws/templates/utils/contextualized/filter/scoped.rb', line 27 def filter(, memo, _) scope.instance_exec(, memo, &scoped_filter) end |