Class: Simpacker::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_path:) ⇒ Configuration

Returns a new instance of Configuration.



7
8
9
10
11
# File 'lib/simpacker/configuration.rb', line 7

def initialize(root_path:)
  @root_path = root_path
  @config_path = @root_path.join("config/simpacker.yml")
  @env = Rails.env
end

Instance Attribute Details

#config_pathObject

Returns the value of attribute config_path.



5
6
7
# File 'lib/simpacker/configuration.rb', line 5

def config_path
  @config_path
end

#envObject

Returns the value of attribute env.



5
6
7
# File 'lib/simpacker/configuration.rb', line 5

def env
  @env
end

#root_pathObject

Returns the value of attribute root_path.



5
6
7
# File 'lib/simpacker/configuration.rb', line 5

def root_path
  @root_path
end

Instance Method Details

#cache_manifest?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/simpacker/configuration.rb', line 17

def cache_manifest?
  data.fetch("cache_manifest")
end

#manifest_pathObject



13
14
15
# File 'lib/simpacker/configuration.rb', line 13

def manifest_path
  root_path.join(data.fetch("manifest_path"))
end