Class: Pageflow::PageTypeFeature

Inherits:
Feature
  • Object
show all
Defined in:
lib/pageflow/page_type_feature.rb

Overview

A feature to enable a PageType.

Since:

  • 0.9

Instance Attribute Summary collapse

Attributes inherited from Feature

#name

Instance Method Summary collapse

Constructor Details

#initialize(page_type) ⇒ PageTypeFeature

Returns a new instance of PageTypeFeature.

Since:

  • 0.9



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

Since:

  • 0.9



6
7
8
# File 'lib/pageflow/page_type_feature.rb', line 6

def page_type
  @page_type
end

Instance Method Details

#enable(config) ⇒ Object

Since:

  • 0.9



13
14
15
# File 'lib/pageflow/page_type_feature.rb', line 13

def enable(config)
  config.page_types.register(page_type)
end

#name_translation_keyObject

Since:

  • 0.9



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