Module: ContextFilters::Context::GlobalFilters
- Included in:
- Global
- Defined in:
- lib/context-filters/context/global_filters.rb
Overview
simple access to global priority filters
Instance Method Summary collapse
-
#filter(priority, options = nil, &block) ⇒ Object
defines new filter for given
priority
andoptions
. -
#initialize_priority_filters(priority_filters) ⇒ Object
private
sets up the priorities order for filters.
-
#priority_filters ⇒ PriorityFilters
private
Shared list of filters.
Instance Method Details
#filter(priority, options = nil, &block) ⇒ Object
defines new filter for given priority
and options
33 34 35 |
# File 'lib/context-filters/context/global_filters.rb', line 33 def filter(priority, = nil, &block) priority_filters.store(priority, , &block) end |
#initialize_priority_filters(priority_filters) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
sets up the priorities order for filters
23 24 25 |
# File 'lib/context-filters/context/global_filters.rb', line 23 def initialize_priority_filters(priority_filters) @priority_filters = ContextFilters::Filters::PriorityFilters.new(priority_filters) end |
#priority_filters ⇒ PriorityFilters
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns shared list of filters.
16 17 18 |
# File 'lib/context-filters/context/global_filters.rb', line 16 def priority_filters @priority_filters ||= initialize_priority_filters(nil) end |