Class: Pageflow::EntryTypeConfiguration::FeaturesDelegator Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/pageflow/entry_type_configuration.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 15.1

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config

Returns:

  • (Object)

    the current value of config



29
30
31
# File 'lib/pageflow/entry_type_configuration.rb', line 29

def config
  @config
end

#entry_typeObject

Returns the value of attribute entry_type

Returns:

  • (Object)

    the current value of entry_type



29
30
31
# File 'lib/pageflow/entry_type_configuration.rb', line 29

def entry_type
  @entry_type
end

Instance Method Details

#enable_by_default(name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 15.1



43
44
45
# File 'lib/pageflow/entry_type_configuration.rb', line 43

def enable_by_default(name)
  config.features.enable_by_default(name)
end

#register(feature, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 15.1



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/pageflow/entry_type_configuration.rb', line 30

def register(feature, &block)
  return register(Feature.new(feature, &block)) if feature.is_a?(String)

  entry_type_feature = Feature.new(
    feature.name,
    name_translation_key: feature.name_translation_key
  ) do |feature_config|
    feature_config.for_entry_type(entry_type, &feature.method(:enable))
  end

  config.features.register(entry_type_feature)
end