Class: Vizier::DefaultPresenterConfig
- Inherits:
-
Object
- Object
- Vizier::DefaultPresenterConfig
- Defined in:
- lib/vizier/default_presenter_config.rb
Overview
A base implementation of a default presenter configuration, used by by PresenterFactory to provide a fall-through for unmapped types.
This uses ‘NullPresenter` and `ReadOnlyPolicy` to have generic, fully delegating presenters with a `show?` permission passing unconditionally.
Instance Attribute Summary collapse
-
#config_type ⇒ Object
readonly
Returns the value of attribute config_type.
Instance Method Summary collapse
- #for(type) ⇒ Object
-
#initialize(config_type) ⇒ DefaultPresenterConfig
constructor
A new instance of DefaultPresenterConfig.
Constructor Details
#initialize(config_type) ⇒ DefaultPresenterConfig
Returns a new instance of DefaultPresenterConfig.
12 13 14 |
# File 'lib/vizier/default_presenter_config.rb', line 12 def initialize(config_type) @config_type = config_type end |
Instance Attribute Details
#config_type ⇒ Object (readonly)
Returns the value of attribute config_type.
10 11 12 |
# File 'lib/vizier/default_presenter_config.rb', line 10 def config_type @config_type end |
Instance Method Details
#for(type) ⇒ Object
16 17 18 |
# File 'lib/vizier/default_presenter_config.rb', line 16 def for(type) config_type.new(type, NullPresenter, ReadOnlyPolicy) end |