Method: Hanami::Slice::ClassMethods#export

Defined in:
lib/hanami/slice.rb

#export(keys) ⇒ self

Specifies the components to export from the slice.

Slices importing from this slice can import the specified components only.

Examples:

module MySlice
  class Slice < Hanami::Slice
    export ["search", "index_entity"]
  end
end

Parameters:

  • keys (Array<String>)

    the component keys to export

Returns:

  • (self)

Since:

  • 2.0.0



664
665
666
667
# File 'lib/hanami/slice.rb', line 664

def export(keys)
  container.config.exports = keys
  self
end