Class: Pageflow::PageTypeFeature
- Defined in:
- lib/pageflow/page_type_feature.rb
Overview
A feature to enable a PageType.
Instance Attribute Summary collapse
- #page_type ⇒ Object readonly
Attributes inherited from Feature
Instance Method Summary collapse
- #enable(config) ⇒ Object
-
#initialize(page_type) ⇒ PageTypeFeature
constructor
A new instance of PageTypeFeature.
- #name_translation_key ⇒ Object
Constructor Details
#initialize(page_type) ⇒ PageTypeFeature
Returns a new instance of PageTypeFeature.
8 9 10 11 |
# File 'lib/pageflow/page_type_feature.rb', line 8 def initialize(page_type) super("page_type.#{page_type.name}") @page_type = page_type end |
Instance Attribute Details
#page_type ⇒ Object (readonly)
6 7 8 |
# File 'lib/pageflow/page_type_feature.rb', line 6 def page_type @page_type end |
Instance Method Details
#enable(config) ⇒ Object
13 14 15 |
# File 'lib/pageflow/page_type_feature.rb', line 13 def enable(config) config.page_types.register(page_type) end |
#name_translation_key ⇒ Object
17 18 19 |
# File 'lib/pageflow/page_type_feature.rb', line 17 def name_translation_key "pageflow.#{page_type.name}.page_type_feature_name" end |