Class: Hanami::Providers::Assets Private

Inherits:
Hanami::Provider::Source show all
Defined in:
lib/hanami/providers/assets.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.

Provider source to register routes helper component in Hanami slices.

See Also:

Since:

  • 2.0.0

Instance Attribute Summary

Attributes inherited from Hanami::Provider::Source

#slice

Instance Method Summary collapse

Methods inherited from Hanami::Provider::Source

#initialize, #target_container

Constructor Details

This class inherits a constructor from Hanami::Provider::Source

Instance Method Details

#prepareObject

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:

  • 2.0.0



14
15
16
# File 'lib/hanami/providers/assets.rb', line 14

def prepare
  require "hanami/assets"
end

#startObject

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:

  • 2.0.0



19
20
21
22
23
24
25
# File 'lib/hanami/providers/assets.rb', line 19

def start
  root = slice.app.root.join("public", "assets", Hanami::Assets.public_assets_dir(target).to_s)

  assets = Hanami::Assets.new(config: slice.config.assets, root: root)

  register(:assets, assets)
end