Class: Moderate::Configuration::FilterPolicy
- Inherits:
-
Data
- Object
- Data
- Moderate::Configuration::FilterPolicy
- Defined in:
- lib/moderate/configuration.rb
Overview
A per-(class, field) filter policy. ‘class_name` is stored as a STRING and constantized lazily by the consumer, same as `user_class`, so declaring a filter for a model that isn’t loaded yet is fine. ‘adapter` is the adapter NAME (a symbol) resolved against the adapters registry at classify time —never the adapter object itself, so swapping a backend is a one-line change.
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Instance Method Summary collapse
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter
36 37 38 |
# File 'lib/moderate/configuration.rb', line 36 def adapter @adapter end |
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name
36 37 38 |
# File 'lib/moderate/configuration.rb', line 36 def class_name @class_name end |
#field ⇒ Object (readonly)
Returns the value of attribute field
36 37 38 |
# File 'lib/moderate/configuration.rb', line 36 def field @field end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode
36 37 38 |
# File 'lib/moderate/configuration.rb', line 36 def mode @mode end |
Instance Method Details
#block? ⇒ Boolean
38 |
# File 'lib/moderate/configuration.rb', line 38 def block? = mode == :block |
#flag? ⇒ Boolean
39 |
# File 'lib/moderate/configuration.rb', line 39 def flag? = mode == :flag |
#off? ⇒ Boolean
37 |
# File 'lib/moderate/configuration.rb', line 37 def off? = mode == :off |