Class: Aker::Configuration::Slice

Inherits:
Object
  • Object
show all
Defined in:
lib/aker/configuration.rb

Overview

A persistent, reappliable fragment of a Aker::Configuration. This class enables Aker extensions to provide default chunks of configuration that will apply to every newly-created configuration instance.

In general this facility is not needed by applications that use Aker; it’s intended only for libraries that provide additional functionality on top of Aker and need to provide reasonable defaults and/or mandatory infrastructure for those features.

Extensions of that kind should create an instance of this class and register it with add_default_slice (or pass a block to that method to have it create one on their behalf).

Most of Aker’s own functionality (including all authorities and modes) are registered using slices internally. If you are considering writing one, take a look at Aker’s source for examples.

Since:

  • 2.2.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&contents) ⇒ Slice

Returns a new instance of Slice.

Parameters:

  • contents

    the configuration DSL fragment comprising this slice.

Since:

  • 2.2.0



447
448
449
# File 'lib/aker/configuration.rb', line 447

def initialize(&contents)
  @contents = contents
end

Instance Attribute Details

#contentsProc

Returns the configuration DSL fragment comprising this slice.

Returns:

  • (Proc)

    the configuration DSL fragment comprising this slice.

Since:

  • 2.2.0



442
443
444
# File 'lib/aker/configuration.rb', line 442

def contents
  @contents
end