Class: Vizier::DefaultPresenterConfig

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_typeObject (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