Class: Manifester::Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/manifester/instance.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_path: Rails.root, public_root_dir: "public", public_output_dir: "packs", cache_manifest: false, fallback_to_webpacker: -> {}) ⇒ Instance

Returns a new instance of Instance.



6
7
8
# File 'lib/manifester/instance.rb', line 6

def initialize(root_path: Rails.root, public_root_dir: "public", public_output_dir: "packs", cache_manifest: false, fallback_to_webpacker: -> {})
  @root_path, @public_root_dir, @public_output_dir, @cache_manifest, @fallback_to_webpacker = root_path, public_root_dir, public_output_dir, cache_manifest, fallback_to_webpacker
end

Instance Attribute Details

#root_pathObject (readonly)

Returns the value of attribute root_path.



4
5
6
# File 'lib/manifester/instance.rb', line 4

def root_path
  @root_path
end

Instance Method Details

#configObject



10
11
12
13
14
15
16
17
18
# File 'lib/manifester/instance.rb', line 10

def config
  @config ||= Manifester::Configuration.new(
    root_path: @root_path,
    public_root_dir: @public_root_dir,
    public_output_dir: @public_output_dir,
    cache_manifest: @cache_manifest,
    fallback_to_webpacker: @fallback_to_webpacker
  )
end

#manifestObject



20
21
22
# File 'lib/manifester/instance.rb', line 20

def manifest
  @manifest ||= Manifester::Manifest.new self
end